Skip to content
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

const fn integer operations #51299

Merged
merged 5 commits into from
Jun 4, 2018
Merged

const fn integer operations #51299

merged 5 commits into from
Jun 4, 2018

Conversation

faern
Copy link
Contributor

@faern faern commented Jun 2, 2018

A follow up to #51171
Fixes #51267

Makes a lot of the integer methods (swap_bytes, count_ones etc) const fns. See #51267 for a discussion about why this is wanted and the solution used.

@rust-highfive
Copy link
Collaborator

r? @joshtriplett

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 2, 2018
@Mark-Simulacrum Mark-Simulacrum added the relnotes Marks issues that should be documented in the release notes of the next release. label Jun 2, 2018
const LE_I128: i128 = -999999i128.to_le();

fn main() {
assert_eq!(BE_U32, 55u32.to_be());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To ensure that the right hand side isn't const evaluated you need to pass the literal through a dummy function that isn't const fn and is also #[inline(never)]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oli-obk Doesn't the codebase have a dedicated black-boxing function for that purpose?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, I think it's test::black_box, not sure if that's available in run-pass tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I was able to use test::black_box.

Btw. Do you think this test is correctly placed? I first put it under ui to just make sure it compiled, never ran any assertions. Then I moved it to run-pass 🤷‍♂️

Also, should I add tests for all methods I made const fns?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More tests are always great ;)

run-pass is the right place for it

@oli-obk
Copy link
Contributor

oli-obk commented Jun 3, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Jun 3, 2018

📌 Commit 7df0099 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2018
@bors
Copy link
Contributor

bors commented Jun 3, 2018

⌛ Testing commit 7df0099 with merge 6e0afd14bc500ff47a5cc315a21e24536525d7c7...

@bors
Copy link
Contributor

bors commented Jun 3, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 3, 2018
@rust-highfive
Copy link
Collaborator

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:40:05] test [run-pass] run-pass/zero-sized-vec-push.rs ... ok
[01:40:05] 
[01:40:05] failures:
[01:40:05] 
[01:40:05] ---- [run-pass] run-pass/const-endianess.rs stdout ----
[01:40:05] error: compilation failed!
[01:40:05] status: exit code: 101
[01:40:05] status: exit code: 101
[01:40:05] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/const-endianess.rs" "--target=asmjs-unknown-emscripten" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/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-endianess/auxiliary"
[01:40:05] ------------------------------------------
[01:40:05] 
[01:40:05] ------------------------------------------
[01:40:05] stderr:
[01:40:05] stderr:
[01:40:05] ------------------------------------------
[01:40:05] error: linking with `emcc` failed: exit code: 1
[01:40:05]   |
[01:40:05]   = 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-endianess/a.const_endianess0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess1.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess2.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess3.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess4.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess5.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess6.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess7.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess8.rcgu.o" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.js" "-s" "EXPORTED_FUNCTIONS=[\"_main\",\"_rust_eh_personality\"]" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.crate.allocator.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-endianess/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/libtest-818ff740b2707f00.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libterm-b839a5796ea44350.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libgetopts-51ccaccdb7d8163e.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libstd-054b1990e7d4c7b6.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libpanic_unwind-339c04ae4132d76c.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libunwind-e8ee297dbe25844d.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc_system-5e948e8e93b206b3.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liblibc-8a689bacec06a191.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc-057d09441be39ab5.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcore-b8b7fb254e56b0ab.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcompiler_builtins-371c588c1a3805de.rlib" "-l" "c" "-s" "ERROR_ON_UNDEFINED_SYMBOLS=1" "-s" "ABORTING_MALLOC=0"
[01:40:05]   = note: Unsupported:   %99 = call i128 @_ZN4test9black_box17ha1518cd2940bf411E(i128 999999)
[01:40:05]           LLVM ERROR: Instruction not yet supported for integer types larger than 64 bits
[01:40:05]           Traceback (most recent call last):
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13//emcc", line 13, in <module>
[01:40:05]               emcc.run()
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emcc.py", line 1526, in run
[01:40:05]               final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/tools/shared.py", line 1963, in emscripten
[01:40:05]               call_emscripten(cmdline)
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 2190, in _main
[01:40:05]               temp_files.run_and_clean(lambda: main(
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/tools/tempfiles.py", line 78, in run_and_clean
[01:40:05]               return func()
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 2195, in <lambda>
[01:40:05]               DEBUG=DEBUG,
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 2095, in main
[01:40:05]               temp_files=temp_files, DEBUG=DEBUG)
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 93, in emscript
[01:40:05]               backend_output = compile_js(infile, settings, temp_files, DEBUG)
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 127, in compile_js
[01:40:05]               backend_output = open(temp_js).read()
[01:40:05]           IOError: [Errno 2] No such file or directory: '/tmp/tmpJXtuSk.4.js'
[01:40:05] 
[01:40:05] error: aborting due to previous error
[01:40:05] 
[01:40:05] 
[01:40:05] 
[01:40:05] ------------------------------------------
[01:40:05] 
[01:40:05] thread '[run-pass] run-pass/const-endianess.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[01:40:05] 
[01:40:05] 
[01:40:05] failures:
[01:40:05]     [run-pass] run-pass/const-endianess.rs
[01:40:05]     [run-pass] run-pass/const-endianess.rs
[01:40:05] 
[01:40:05] test result: FAILED. 2849 passed; 1 failed; 171 ignored; 0 measured; 0 filtered out
[01:40:05] 
[01:40:05] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[01:40:05] 
[01:40:05] 
[01:40: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/4.1.1_64bit/bin/node" "--host-rustcflags" "-Crpath -Zunstable-options " "--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" "6.0.1\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:40:05] 
[01:40:05] 
[01:40: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:40:05] Build completed unsuccessfully in 1:36:01

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)

@rust-highfive
Copy link
Collaborator

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:40:05] ---- [run-pass] run-pass/const-endianess.rs stdout ----
[01:40:05] 
[01:40:05] error: compilation failed!
[01:40:05] status: exit code: 101
[01:40:05] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/const-endianess.rs" "--target=asmjs-unknown-emscripten" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/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-endianess/auxiliary"
[01:40:05] ------------------------------------------
[01:40:05] 
[01:40:05] ------------------------------------------
[01:40:05] stderr:
[01:40:05] stderr:
[01:40:05] ------------------------------------------
[01:40:05] error: linking with `emcc` failed: exit code: 1
[01:40:05]   |
[01:40:05]   = 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-endianess/a.const_endianess0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess1.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess2.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess3.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess4.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess5.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess6.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess7.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.const_endianess8.rcgu.o" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.js" "-s" "EXPORTED_FUNCTIONS=[\"_main\",\"_rust_eh_personality\"]" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-endianess/a.crate.allocator.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-endianess/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/libtest-818ff740b2707f00.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libterm-b839a5796ea44350.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libgetopts-51ccaccdb7d8163e.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libstd-054b1990e7d4c7b6.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libpanic_unwind-339c04ae4132d76c.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libunwind-e8ee297dbe25844d.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc_system-5e948e8e93b206b3.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liblibc-8a689bacec06a191.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc-057d09441be39ab5.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcore-b8b7fb254e56b0ab.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcompiler_builtins-371c588c1a3805de.rlib" "-l" "c" "-s" "ERROR_ON_UNDEFINED_SYMBOLS=1" "-s" "ABORTING_MALLOC=0"
[01:40:05]   = note: Unsupported:   %99 = call i128 @_ZN4test9black_box17ha1518cd2940bf411E(i128 999999)
[01:40:05]           LLVM ERROR: Instruction not yet supported for integer types larger than 64 bits
[01:40:05]           Traceback (most recent call last):
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13//emcc", line 13, in <module>
[01:40:05]               emcc.run()
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emcc.py", line 1526, in run
[01:40:05]               final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/tools/shared.py", line 1963, in emscripten
[01:40:05]               call_emscripten(cmdline)
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 2190, in _main
[01:40:05]               temp_files.run_and_clean(lambda: main(
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/tools/tempfiles.py", line 78, in run_and_clean
[01:40:05]               return func()
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 2195, in <lambda>
[01:40:05]               DEBUG=DEBUG,
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 2095, in main
[01:40:05]               temp_files=temp_files, DEBUG=DEBUG)
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 93, in emscript
[01:40:05]               backend_output = compile_js(infile, settings, temp_files, DEBUG)
[01:40:05]             File "/emsdk-portable/emscripten/1.37.13/emscripten.py", line 127, in compile_js
[01:40:05]               backend_output = open(temp_js).read()
[01:40:05]           IOError: [Errno 2] No such file or directory: '/tmp/tmpJXtuSk.4.js'
[01:40:05] 
[01:40:05] error: aborting due to previous error
[01:40:05] 
[01:40:05] 
---
[01:40:05] 
[01:40:05] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[01:40:05] 
[01:40:05] 
[01:40: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/4.1.1_64bit/bin/node" "--host-rustcflags" "-Crpath -Zunstable-options " "--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" "6.0.1\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:40:05] 
[01:40:05] 
[01:40: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:40:05] Build completed unsuccessfully in 1:36:01

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)

fn main() {
assert_eq!(BE_U32, b(55u32).to_be());
assert_eq!(LE_U32, b(55u32).to_le());
assert_eq!(BE_U128, b(999999u128).to_be());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should ignore this test on asm-js, because it doesn't support 128 bit integers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the error it looks like the call to black_box was the problem. But I realized after pushing the fix ignoring that assertion only that I might have to disable the entire test for.. ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I force-pushed a change to the test to conditionally compile everything related to 128 bit integers.

@oli-obk
Copy link
Contributor

oli-obk commented Jun 3, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Jun 3, 2018

📌 Commit 8b5f962 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jun 4, 2018
const fn integer operations

A follow up to rust-lang#51171
Fixes rust-lang#51267

Makes a lot of the integer methods (`swap_bytes`, `count_ones` etc) `const fn`s. See rust-lang#51267 for a discussion about why this is wanted and the solution used.
bors added a commit that referenced this pull request Jun 4, 2018
Rollup of 6 pull requests

Successful merges:

 - #51288 (Remove rustdoc-specific is_import field from HIR)
 - #51299 (const fn integer operations)
 - #51317 (Allow enabling incremental via config.toml)
 - #51323 (Generate br for all two target SwitchInts)
 - #51326 (Various minor slice iterator cleanups)
 - #51329 (Remove the unused `-Z trans-time-graph` flag.)

Failed merges:
@bors bors merged commit 8b5f962 into rust-lang:master Jun 4, 2018
@bors
Copy link
Contributor

bors commented Jun 4, 2018

⌛ Testing commit 8b5f962 with merge 6232478...

@bors
Copy link
Contributor

bors commented Jun 4, 2018

☔ The latest upstream changes (presumably #51334) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 4, 2018
@bors
Copy link
Contributor

bors commented Jun 4, 2018

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 4, 2018
@bjorn3
Copy link
Member

bjorn3 commented Jun 4, 2018

What happened here? Bors tried to test this while a rollup which contained this pr was already merged.

cc @alexcrichton

@TimDiekmann
Copy link
Member

@oli-obk In this PR, some tests are missing. With ui tests, the bug, which was fixed in #53699, would have been discovered way earlier.

@faern faern deleted the const-int-ops branch January 31, 2019 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants