New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make `saturating_add` and `saturating_sub` `const` functions #58246

Merged
merged 9 commits into from Feb 12, 2019

Conversation

@pmccarter
Copy link
Contributor

pmccarter commented Feb 6, 2019

Fixes #58030

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 6, 2019

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aidanhs (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@pmccarter

This comment has been minimized.

Copy link
Contributor Author

pmccarter commented Feb 6, 2019

Thanks @nikic should be covered now.

@nikic

This comment has been minimized.

Copy link
Contributor

nikic commented Feb 7, 2019

The logic here looks fine to me now. I think it would be a bit nicer to combine the code for saturating_add and saturating_sub, as they're nearly the same (the two differences are the used BinOp, and the bounds in the unsigned case).

r? @oli-obk to make sure the const eval stuff is right/idiomatic.

@rust-highfive rust-highfive assigned oli-obk and unassigned aidanhs Feb 7, 2019

@@ -374,6 +374,8 @@ fn is_intrinsic_whitelisted(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> bool
| "overflowing_add" // ~> .wrapping_add
| "overflowing_sub" // ~> .wrapping_sub
| "overflowing_mul" // ~> .wrapping_mul
| "saturating_add" // ~> .saturating_add
| "saturating_sub" // ~> .saturating_sub

This comment has been minimized.

@matthewjasper

This comment has been minimized.

@cramertj

This comment has been minimized.

@Centril

Centril Feb 8, 2019

Contributor

lgtm also

Show resolved Hide resolved src/libcore/num/mod.rs
Show resolved Hide resolved src/librustc_mir/interpret/intrinsics.rs Outdated
@oli-obk

oli-obk approved these changes Feb 7, 2019

Copy link
Contributor

oli-obk left a comment

r=me with the missing flags added

Show resolved Hide resolved src/libcore/num/mod.rs
@nikic

This comment has been minimized.

Copy link
Contributor

nikic commented Feb 7, 2019

@bors r=oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 7, 2019

📌 Commit da13fbd has been approved by oli-obk

let first_term: u128 = l.to_scalar()?.to_bits(l.layout.size)?;
let num_bits = l.layout.size.bits();
if l.layout.abi.is_signed() {
if first_term & (1 << (num_bits-1)) == 0 { // first term is positive

This comment has been minimized.

@RalfJung

RalfJung Feb 8, 2019

Member

So it cannot overflow on the negative side because the smallest possible things we could reach here (for u8, similar for other types) are "0 - 127" and "0 + -128", and both are fine. Correct?

@RalfJung

This comment has been minimized.

Copy link
Member

RalfJung commented Feb 8, 2019

Awesome, thanks!

@bors r=oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 8, 2019

📌 Commit 7854067 has been approved by oli-obk

@RalfJung

This comment has been minimized.

Copy link
Member

RalfJung commented Feb 11, 2019

Prioritizing because this blocks Miri from passing tests.

@bors p=1

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 11, 2019

⌛️ Testing commit 7854067 with merge 085ff9a...

bors added a commit that referenced this pull request Feb 11, 2019

Auto merge of #58246 - pmccarter:master, r=oli-obk
Make `saturating_add` and `saturating_sub` `const` functions

Fixes #58030
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 11, 2019

💔 Test failed - checks-travis

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 11, 2019

The job asmjs of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[01:52:05] failures:
[01:52:05] 
[01:52:05] ---- [run-pass] run-pass/const-int-saturating-arith.rs stdout ----
[01:52:05] 
[01:52:05] error: test compilation failed although it shouldn't!
[01:52:05] status: exit code: 1
[01:52:05] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/const-int-saturating-arith.rs" "-Zthreads=1" "--target=asmjs-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.js" "-Crpath" "-Zunstable-options" "-Lnative=/checkout/obj/build/asmjs-unknown-emscripten/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/auxiliary"
[01:52:05] ------------------------------------------
[01:52:05] 
[01:52:05] ------------------------------------------
[01:52:05] stderr:
[01:52:05] stderr:
[01:52:05] ------------------------------------------
[01:52:05] {"message":"linking with `emcc` failed: exit code: 1","code":null,"level":"error","spans":[],"children":[{"message":"\"emcc\" \"-s\" \"DISABLE_EXCEPTION_CATCHING=0\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.0.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.1.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.2.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.3.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.4.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.5.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.6.rcgu.o\" \"-o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.js\" \"-s\" \"EXPORTED_FUNCTIONS=[\\\"_main\\\",\\\"_rust_eh_personality\\\"]\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.1g7rkt11q6xshkyv.rcgu.o\" \"-O0\" \"--memory-init-file\" \"0\" \"-g0\" \"-s\" \"DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]\" \"-L\" \"/checkout/obj/build/asmjs-unknown-emscripten/native/rust-test-helpers\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/auxiliary\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libstd-a3b039e1022c4e23.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libpanic_unwind-cbe0b279e7e65e1d.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libbacktrace_sys-fbbb4b4310d4461e.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libunwind-0ad99a19fff449db.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_demangle-e12a14701e612489.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liblibc-c485303e37c5b870.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc-5cb2d546769e8afa.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_std_workspace_core-0121858c90ea5f38.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcore-734d5601cb962c5d.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcompiler_builtins-f54f893f2b95b307.rlib\" \"-l\" \"c\" \"-s\" \"ERROR_ON_UNDEFINED_SYMBOLS=1\" \"-s\" \"ABORTING_MALLOC=0\" \"-s\" \"WASM=0\"","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"WARNING:root:object /tmp/emscripten_temp_g5n1Up_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\nWARNING:root:object /tmp/emscripten_temp_g5n1Up_archive_contents/std-a3b039e1022c4e23.std.5qp5rq2h-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_g5n1Up_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\nWARNING:root:object /tmp/emscripten_temp_g5n1Up_archive_contents/std-a3b039e1022c4e23.std.5qp5rq2h-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_jjYfS3_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_jjYfS3_archive_contents/panic_unwind-cbe0b279e7e65e1d.panic_unwind.8k1sskjn-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_jjYfS3_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_jjYfS3_archive_contents/panic_unwind-cbe0b279e7e65e1d.panic_unwind.8k1sskjn-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_FD8XsO_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_FD8XsO_archive_contents/backtrace_sys-fbbb4b4310d4461e.backtrace_sys.em1muf4r-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp__nqBrc_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp__nqBrc_archive_contents/unwind-0ad99a19fff449db.unwind.esdizuvf-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp__nqBrc_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp__nqBrc_archive_contents/unwind-0ad99a19fff449db.unwind.esdizuvf-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_CFMGgx_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_CFMGgx_archive_contents/rustc_demangle-e12a14701e612489.rustc_demangle.a3ffu37k-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_CFMGgx_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_CFMGgx_archive_contents/rustc_demangle-e12a14701e612489.rustc_demangle.a3ffu37k-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_UKtqa4_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\nWARNING:root:object /tmp/emscripten_temp_UKtqa4_archive_contents/libc-c485303e37c5b870.libc.1pxk5tle-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_QLSltm_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\nWARNING:root:object /tmp/emscripten_temp_QLSltm_archive_contents/alloc-5cb2d546769e8afa.alloc.dqq0juu1-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_QLSltm_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\nWARNING:root:object /tmp/emscripten_temp_QLSltm_archive_contents/alloc-5cb2d546769e8afa.alloc.dqq0juu1-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_8SdcWC_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_8SdcWC_archive_contents/rustc_std_workspace_core-0121858c90ea5f38.rustc_std_workspace_core.1npyr7mf-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_Mu2y9C_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\nWARNING:root:object /tmp/emscripten_temp_Mu2y9C_archive_contents/core-734d5601cb962c5d.core.6pdr3aku-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_Mu2y9C_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\nWARNING:root:object /tmp/emscripten_temp_Mu2y9C_archive_contents/core-734d5601cb962c5d.core.6pdr3aku-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nWARNING:root:object /tmp/emscripten_temp_fLzonL_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\nWARNING:root:object /tmp/emscripten_temp_fLzonL_archive_contents/compiler_builtins-f54f893f2b95b307.compiler_builtins.853z8lo6-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\nUnsupported:   %5 = icmp sgt i128 %4, -1\nLLVM ERROR: Signed comparisons not yet supported for integer types larger than 64 bits\nTraceback (most recent call last):\n  File \"/emsdk-portable/emscripten/1.38.15/emcc.py\", line 3094, in <module>\n    sys.exit(run())\n  File \"/emsdk-portable/emscripten/1.38.15/emcc.py\", line 1807, in run\n    final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)\n  File \"/emsdk-portable/emscripten/1.38.15/tools/shared.py\", line 2250, in emscripten\n    emscripten._main(cmdline)\n  File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 2366, in _main\n    return temp_files.run_and_clean(lambda: main(\n  File \"/emsdk-portable/emscripten/1.38.15/tools/tempfiles.py\", line 98, in run_and_clean\n    return func()\n  File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 2371, in <lambda>\n    DEBUG=DEBUG,\n  File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 2297, in main\n    temp_files=temp_files, DEBUG=DEBUG)\n  File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 92, in emscript\n    backend_output = compile_js(infile, temp_files, DEBUG)\n  File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 121, in compile_js\n    jsrun.timeout_run(subprocess.Popen(backend_args, stdout=subprocess.PIPE, universal_newlines=True), note_args=backend_args)\n  File \"/emsdk-portable/emscripten/1.38.15/tools/jsrun.py\", line 24, in timeout_run\n    raise Exception('Subprocess \"' + ' '.join(note_args) + '\" failed with exit code ' + str(proc.returncode) + '!')\nException: Subprocess \"/emsdk-portable/clang/e1.38.15_64bit/llc /tmp/tmpadHyRl/a.bc -march=js -filetype=asm -o /tmp/tmpwtyOIf.4.js -emscripten-stack-size=5242880 -O0 -emscripten-assertions=1 -emscripten-no-aliasing-function-pointers -emscripten-global-base=8 -enable-emscripten-cpp-exceptions -emscripten-no-exit-runtime\" failed with exit code 1!\n","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: linking with `emcc` failed: exit code: 1\n   |\n   = note: \"emcc\" \"-s\" \"DISABLE_EXCEPTION_CATCHING=0\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.0.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.1.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.2.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.3.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.4.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.5.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.const_int_saturating_arith.7rcbfp3g-cgu.6.rcgu.o\" \"-o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.js\" \"-s\" \"EXPORTED_FUNCTIONS=[\\\"_main\\\",\\\"_rust_eh_personality\\\"]\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/a.1g7rkt11q6xshkyv.rcgu.o\" \"-O0\" \"--memory-init-file\" \"0\" \"-g0\" \"-s\" \"DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]\" \"-L\" \"/checkout/obj/build/asmjs-unknown-emscripten/native/rust-test-helpers\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-saturating-arith/auxiliary\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libstd-a3b039e1022c4e23.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libpanic_unwind-cbe0b279e7e65e1d.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libbacktrace_sys-fbbb4b4310d4461e.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libunwind-0ad99a19fff449db.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_demangle-e12a14701e612489.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liblibc-c485303e37c5b870.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc-5cb2d546769e8afa.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/librustc_std_workspace_core-0121858c90ea5f38.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcore-734d5601cb962c5d.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcompiler_builtins-f54f893f2b95b307.rlib\" \"-l\" \"c\" \"-s\" \"ERROR_ON_UNDEFINED_SYMBOLS=1\" \"-s\" \"ABORTING_MALLOC=0\" \"-s\" \"WASM=0\"\n   = note: WARNING:root:object /tmp/emscripten_temp_g5n1Up_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\n           WARNING:root:object /tmp/emscripten_temp_g5n1Up_archive_contents/std-a3b039e1022c4e23.std.5qp5rq2h-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_g5n1Up_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\n           WARNING:root:object /tmp/emscripten_temp_g5n1Up_archive_contents/std-a3b039e1022c4e23.std.5qp5rq2h-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_jjYfS3_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_jjYfS3_archive_contents/panic_unwind-cbe0b279e7e65e1d.panic_unwind.8k1sskjn-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_jjYfS3_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_jjYfS3_archive_contents/panic_unwind-cbe0b279e7e65e1d.panic_unwind.8k1sskjn-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_FD8XsO_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_FD8XsO_archive_contents/backtrace_sys-fbbb4b4310d4461e.backtrace_sys.em1muf4r-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp__nqBrc_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp__nqBrc_archive_contents/unwind-0ad99a19fff449db.unwind.esdizuvf-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp__nqBrc_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp__nqBrc_archive_contents/unwind-0ad99a19fff449db.unwind.esdizuvf-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_CFMGgx_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_CFMGgx_archive_contents/rustc_demangle-e12a14701e612489.rustc_demangle.a3ffu37k-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_CFMGgx_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_CFMGgx_archive_contents/rustc_demangle-e12a14701e612489.rustc_demangle.a3ffu37k-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_UKtqa4_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\n           WARNING:root:object /tmp/emscripten_temp_UKtqa4_archive_contents/libc-c485303e37c5b870.libc.1pxk5tle-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_QLSltm_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\n           WARNING:root:object /tmp/emscripten_temp_QLSltm_archive_contents/alloc-5cb2d546769e8afa.alloc.dqq0juu1-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_QLSltm_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\n           WARNING:root:object /tmp/emscripten_temp_QLSltm_archive_contents/alloc-5cb2d546769e8afa.alloc.dqq0juu1-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_8SdcWC_archive_contents/rust.metadata.bin is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_8SdcWC_archive_contents/rustc_std_workspace_core-0121858c90ea5f38.rustc_std_workspace_core.1npyr7mf-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_Mu2y9C_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\n           WARNING:root:object /tmp/emscripten_temp_Mu2y9C_archive_contents/core-734d5601cb962c5d.core.6pdr3aku-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_Mu2y9C_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\n           WARNING:root:object /tmp/emscripten_temp_Mu2y9C_archive_contents/core-734d5601cb962c5d.core.6pdr3aku-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           WARNING:root:object /tmp/emscripten_temp_fLzonL_archive_contents/rust.metadata.bin is not LLVM bitcode, cannot link\n           WARNING:root:object /tmp/emscripten_temp_fLzonL_archive_contents/compiler_builtins-f54f893f2b95b307.compiler_builtins.853z8lo6-cgu.0.rcgu.bc.z is not valid according to llvm-nm, cannot link\n           Unsupported:   %5 = icmp sgt i128 %4, -1\n           LLVM ERROR: Signed comparisons not yet supported for integer types larger than 64 bits\n           Traceback (most recent call last):\n             File \"/emsdk-portable/emscripten/1.38.15/emcc.py\", line 3094, in <module>\n               sys.exit(run())\n             File \"/emsdk-portable/emscripten/1.38.15/emcc.py\", line 1807, in run\n               final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)\n             File \"/emsdk-portable/emscripten/1.38.15/tools/shared.py\", line 2250, in emscripten\n               emscripten._main(cmdline)\n             File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 2366, in _main\n               return temp_files.run_and_clean(lambda: main(\n             File \"/emsdk-portable/emscripten/1.38.15/tools/tempfiles.py\", line 98, in run_and_clean\n               return func()\n             File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 2371, in <lambda>\n               DEBUG=DEBUG,\n             File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 2297, in main\n               temp_files=temp_files, DEBUG=DEBUG)\n             File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 92, in emscript\n               backend_output = compile_js(infile, temp_files, DEBUG)\n             File \"/emsdk-portable/emscripten/1.38.15/emscripten.py\", line 121, in compile_js\n               jsrun.timeout_run(subprocess.Popen(backend_args, stdout=subprocess.PIPE, universal_newlines=True), note_args=backend_args)\n             File \"/emsdk-portable/emscripten/1.38.15/tools/jsrun.py\", line 24, in timeout_run\n               raise Exception('Subprocess \"' + ' '.join(note_args) + '\" failed with exit code ' + str(proc.returncode) + '!')\n           Exception: Subprocess \"/emsdk-portable/clang/e1.38.15_64bit/llc /tmp/tmpadHyRl/a.bc -march=js -filetype=asm -o /tmp/tmpwtyOIf.4.js -emscripten-stack-size=5242880 -O0 -emscripten-assertions=1 -emscripten-no-aliasing-function-pointers -emscripten-global-base=8 -enable-emscripten-cpp-exceptions -emscripten-no-exit-runtime\" failed with exit code 1!\n           \n\n"}
[01:52:05] 
[01:52:05] ------------------------------------------
[01:52:05] 
[01:52:05] thread '[run-pass] run-pass/const-int-saturating-arith.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
---
[01:52:05] 
[01:52:05] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:52:05] 
[01:52:05] 
[01:52:05] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/run-pass" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass" "--stage-id" "stage2-asmjs-unknown-emscripten" "--mode" "run-pass" "--target" "asmjs-unknown-emscripten" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/emsdk-portable/node/8.9.1_64bit/bin/node" "--host-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/asmjs-unknown-emscripten/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "8.0.0\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:52:05] 
[01:52:05] 
[01:52:05] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target asmjs-unknown-emscripten src/test/run-pass src/test/run-fail src/libstd src/liballoc src/libcore
[01:52:05] Build completed unsuccessfully in 1:46:28
---
travis_time:end:0059d2f8:start=1549881222344444099,finish=1549881222366047486,duration=21603387
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:3597e162
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0f899757
travis_time:start:0f899757
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:255ab0c0
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@nikic

This comment has been minimized.

Copy link
Contributor

nikic commented Feb 11, 2019

LLVM ERROR: Signed comparisons not yet supported for integer types larger than 64 bits

You'll have to skip the test on emscripten, as it uses 128 bit integers.

@nikic

This comment has been minimized.

Copy link
Contributor

nikic commented Feb 11, 2019

@bors r=oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 11, 2019

📌 Commit b04d8aa has been approved by oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 11, 2019

⌛️ Testing commit b04d8aa with merge ba61cdb...

bors added a commit that referenced this pull request Feb 11, 2019

Auto merge of #58246 - pmccarter:master, r=oli-obk
Make `saturating_add` and `saturating_sub` `const` functions

Fixes #58030
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 11, 2019

💔 Test failed - status-appveyor

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Feb 12, 2019

Seemingly spurious; build was actually successful... @bors retry

cc #58160

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 12, 2019

⌛️ Testing commit b04d8aa with merge ba2853b...

bors added a commit that referenced this pull request Feb 12, 2019

Auto merge of #58246 - pmccarter:master, r=oli-obk
Make `saturating_add` and `saturating_sub` `const` functions

Fixes #58030
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 12, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing ba2853b to master...

@bors bors added the merged-by-bors label Feb 12, 2019

@bors bors merged commit b04d8aa into rust-lang:master Feb 12, 2019

1 check passed

homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment