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

Don't report compile-time errors for promoteds #49779

Merged
merged 2 commits into from
Apr 24, 2018

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Apr 8, 2018

Fixes the regression part of #49760, the missing warnings still are missing

r? @eddyb

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 8, 2018
@oli-obk oli-obk added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 8, 2018
@TimNN
Copy link
Contributor

TimNN commented Apr 8, 2018

Your PR failed on Travis. 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.
Resolving deltas: 100% (613251/613251), completed with 4883 local objects.
---
[00:00:50] configure: rust.quiet-tests     := True
---
[00:05:17] tidy error: /checkout/src/test/ui/type-dependent-def-issue-49241.rs:14: line longer than 100 chars
[00:05:18] some tidy checks failed
[00:05:18]
[00:05:18]
[00:05:18] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:05:18] expected success, got: exit code: 1
[00:05:18]
[00:05:18]
[00:05:18] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:05:18] Build completed unsuccessfully in 0:02:03
[00:05:18] Makefile:79: recipe for target 'tidy' failed
[00:05:18] make: *** [tidy] Error 1

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.

@TimNN
Copy link
Contributor

TimNN commented Apr 8, 2018

Your PR failed on Travis. 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.
Resolving deltas: 100% (613250/613250), completed with 4885 local objects.
---
[00:00:43] configure: rust.quiet-tests     := True
---
[00:45:17] ............................................................................i.......................
[00:45:23] ...................i................................................................................
---
[00:45:59] .................................................................................................i..
[00:46:06] .......................................................................i............................
---
[00:47:02] .............................................i......................................................
---
[00:51:01] .............................i......................................................................
[00:51:16] ..............................................................i.....................................
[00:51:32] ...............................................i....................................................
[00:51:53] ....................................................................................................
[00:52:15] ....................................................................................................
[00:52:37] ....................................................................................................
[00:53:02] ...i...............................................................................................i
[00:53:29] ..............................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:53:40] ......................
[00:54:11] ....................................................................................................
[00:54:48] .................................................................ii.................................
[00:55:33] ............................i....................................................itest [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[00:55:41] .ii...............
[00:56:23] .........................................................................................iiiiiii....
---
[00:58:38] ...................i............................................................ii.iii..............
[00:58:46] ....................................................................................................
[00:58:54] .........i..............................i...........................................................
[00:59:01] ....................................................................................................
[00:59:08] .....................i..............................................................................
[00:59:16] ....................................................................................................
[00:59:26] ....................................................................................................
[00:59:37] ....................................................................................................
[00:59:48] ....................................................................................................
[01:00:01] ....................................................................................................
[01:00:10] ..............i.....................................................................................
[01:00:20] ..................i..ii.............................................................................
[01:00:30] ....................................................................................................
[01:00:40] ....................................................................................................
[01:00:49] .....................................................................................i..............
[01:01:00] ...............................i....................................................................
---
[01:01:37] ...........................i........................................................................
[01:01:38] ....................................................................i...............................
[01:01:39] ................i.......................................................
---
[01:01:55] .............i........................
---
[01:02:24] i...i..ii....i.............ii.........iii......i..i...i...ii..i..i..ii.....
---
[01:02:27] i.......i......................i.......
---
[01:03:06] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i........ii.
[01:03:07] ....ii...
---
[01:11:06] ........F...........................................................................................
[01:12:42] .....i..............................................................................................
---
[01:13:03] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/const-evalutation-ice.stage2-x86_64-unknown-linux-gnu.aux" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/const-evalutation-ice.stage2-x86_64-unknown-linux-gnu" "/checkout/src/test/rustdoc/const-evalutation-ice.rs"
---
[01:13:03] 22 | pub type _S = [usize; 0 - (mem::size_of::<S>() != 4) as usize];
[01:13:03]    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
---
[01:13:03] 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/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--rustdoc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/checkout/src/test/rustdoc" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zmiri -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zmiri -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/u4409176 .

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.

@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 8, 2018

so... this has amplified the breaking change for constants with errors (#49765). Before it was allowed to declare a const FOO: usize = 0 - 1;, which produced a warning but was unusable. Now this produces an error (now being since the miri merger). This PR now does the same for array lengths of unused type aliases like type Foo = [i32; 0 - 1];.

This is a breaking change. Making these errors be warnings instead would remove all errors from constants and move them to the use-site. I don't think we can do this in a more fine-grained way. We could make the warning deny by default, so it doesn't cause dependencies to fail from compiling.

@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 8, 2018

I simplified this PR to the bare minimum, so only the promoted-changes

@TimNN
Copy link
Contributor

TimNN commented Apr 8, 2018

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.
[00:00:46] configure: rust.quiet-tests     := True
---
[00:41:48] ............................................................................i.......................
[00:41:54] .....F..F............i..............................................................................
---
[00:42:30] ...................................................................................................i
[00:42:37] .........................................................................i..........................
[00:42:42] ....................................................................................................
[00:42:49] ....................................................................................................
[00:42:57] ....................................................................................................
ant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/issue-43197.rs","byte_start":715,"byte_end":716,"line_start":22,"line_end":22,"column_start":26,"column_end":27,"is_primary":true,"text":[{"text":"    println!(\"{} {}\", X, Y);","highlight_start":26,"highlight_end":27}],"label":"referenced constant has errors","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/issue-43197.rs:22:26\n   |\nLL |     println!(\"{} {}\", X, Y);\n   |                          ^ referenced constant has errors\n\n"}
---
[00:42:59] 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/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zmiri -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zmiri -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:42:59] expected success, got: exit code: 101
[00:42:59]
[00:42:59]
[00:42:59] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:42:59] Build completed unsuccessfully in 0:02:21
[00:42:59] make: *** [check] Error 1
[00:42:59] Makefile:58: recipe for target 'check' failed

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)

@eddyb
Copy link
Member

eddyb commented Apr 10, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Apr 10, 2018

📌 Commit 95946e1 has been approved by eddyb

@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 Apr 10, 2018
@bors
Copy link
Contributor

bors commented Apr 12, 2018

⌛ Testing commit 95946e1 with merge edfe628...

bors added a commit that referenced this pull request Apr 12, 2018
Don't report compile-time errors for promoteds

Fixes the regression part of #49760, the missing warnings still are missing

r? @eddyb
@bors
Copy link
Contributor

bors commented Apr 12, 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 Apr 12, 2018
@rust-highfive
Copy link
Collaborator

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:01:32] - warning: constant evaluation error
[01:01:32] + warning: attempt to subtract with overflow
[01:01:32] 2   --> $DIR/promoted_errors.rs:14:20
[01:01:32] 3    |
[01:01:32] 4 LL |     println!("{}", 0u32 - 1);
[01:01:32]
[01:01:32] -    |                    ^^^^^^^^ attempted to do overflowing math
[01:01:32] +    |                    ^^^^^^^^
[01:01:32] 6    |
[01:01:32] 7    = note: #[warn(const_err)] on by default
[01:01:32] 8
[01:01:32]
[01:01:32] - warning: constant evaluation error
[01:01:32] -   --> $DIR/promoted_errors.rs:14:20
[01:01:32] -    |
[01:01:32] - LL |     println!("{}", 0u32 - 1);
[01:01:32] -    |                    ^^^^^^^^ attempted to do overflowing math
[01:01:32] -
[01:01:32] - warning: constant evaluation error
[01:01:32] + warning: attempt to subtract with overflow
[01:01:32] 16   --> $DIR/promoted_errors.rs:17:14
[01:01:32] 17    |
[01:01:32] 18 LL |     let _x = 0u32 - 1;
[01:01:32]
[01:01:32] -    |              ^^^^^^^^ attempted to do overflowing math
[01:01:32] +    |              ^^^^^^^^
[01:01:32] 20
[01:01:32] 21 warning: attempt to divide by zero
[01:01:32] 22   --> $DIR/promoted_errors.rs:19:20
[01:01:32]
[01:01:32]
[01:01:32] The actual stderr differed from the expected stderr.
[01:01:32] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stderr
[01:01:32] To update references, run this command from build directory:
[01:01:32] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'const-eval/promoted_errors.rs'
[01:01:32]
[01:01:32] error: 1 errors occurred comparing output.
[01:01:32] status: exit code: 0
[01:01:32] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-eval/promoted_errors.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-Zmiri" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[01:01:32] {"message":"attempt to subtract with overflow","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":528,"byte_end":536,"line_start":14,"line_end":14,"column_start":20,"column_end":28,"is_primary":true,"text":[{"text":"    println!(\"{}\", 0u32 - 1);","highlight_start":20,"highlight_end":28}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"#[warn(const_err)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: attempt to subtract with overflow\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:14:20\n   |\nLL |     println!(\"{}\", 0u32 - 1);\n   |                    ^^^^^^^^\n   |\n   = note: #[warn(const_err)] on by default\n\n"}
[01:01:32] {"message":"attempt to subtract with overflow","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":600,"byte_end":608,"line_start":17,"line_end":17,"column_start":14,"column_end":22,"is_primary":true,"text":[{"text":"    let _x = 0u32 - 1;","highlight_start":14,"highlight_end":22}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to subtract with overflow\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:17:14\n   |\nLL |     let _x = 0u32 - 1;\n   |              ^^^^^^^^\n\n"}
[01:01:32] {"message":"attempt to divide by zero","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":653,"byte_end":660,"line_start":19,"line_end":19,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(1-1));","highlight_start":20,"highlight_end":27}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to divide by zero\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:19:20\n   |\nLL |     println!(\"{}\", 1/(1-1));\n   |                    ^^^^^^^\n\n"}
[01:01:32] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":653,"byte_end":660,"line_start":19,"line_end":19,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(1-1));","highlight_start":20,"highlight_end":27}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:19:20\n   |\nLL |     println!(\"{}\", 1/(1-1));\n   |                    ^^^^^^^ attempted to do overflowing math\n\n"}
[01:01:32] {"message":"attempt to divide by zero","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":724,"byte_end":731,"line_start":22,"line_end":22,"column_start":14,"column_end":21,"is_primary":true,"text":[{"text":"    let _x = 1/(1-1);","highlight_start":14,"highlight_end":21}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to divide by zero\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:22:14\n   |\nLL |     let _x = 1/(1-1);\n   |              ^^^^^^^\n\n"}
[01:01:32] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":724,"byte_end":731,"line_start":22,"line_end":22,"column_start":14,"column_end":21,"is_primary":true,"text":[{"text":"    let _x = 1/(1-1);","highlight_start":14,"highlight_end":21}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:22:14\n   |\nLL |     let _x = 1/(1-1);\n   |              ^^^^^^^ attempted to do overflowing math\n\n"}
[01:01:32] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":800,"byte_end":816,"line_start":25,"line_end":25,"column_start":20,"column_end":36,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(false as u32));","highlight_start":20,"highlight_end":36}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:25:20\n   |\nLL |     println!(\"{}\", 1/(false as u32));\n   |                    ^^^^^^^^^^^^^^^^ attempted to do overflowing math\n\n"}
---
[01:01:32] 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/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Zmiri -Zunstable-options " "--target-rustcflags" "-Crpath -Zmiri -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "6.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:01:32] expected success, got: exit code: 101
[01:01:32]
[01:01:32]
[01:01:32] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:01:32] Build completed unsuccessfully in 0:02:03
[01:01:32] make: *** [check] Error 1
[01:01:32] Makefile:58: recipe for target 'check' failed
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:23659e83:start=1523563422453728857,finish=1523563422460425446,duration=6696589
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:0c985fce
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:0c985fce:start=1523563422466257350,finish=1523563422473708707,duration=7451357
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:281a65d0
$ dmesg | grep -i kill
[   10.887890] init: failsafe main process (1092) killed by TERM signal

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)

1 similar comment
@rust-highfive
Copy link
Collaborator

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:01:32] - warning: constant evaluation error
[01:01:32] + warning: attempt to subtract with overflow
[01:01:32] 2   --> $DIR/promoted_errors.rs:14:20
[01:01:32] 3    |
[01:01:32] 4 LL |     println!("{}", 0u32 - 1);
[01:01:32]
[01:01:32] -    |                    ^^^^^^^^ attempted to do overflowing math
[01:01:32] +    |                    ^^^^^^^^
[01:01:32] 6    |
[01:01:32] 7    = note: #[warn(const_err)] on by default
[01:01:32] 8
[01:01:32]
[01:01:32] - warning: constant evaluation error
[01:01:32] -   --> $DIR/promoted_errors.rs:14:20
[01:01:32] -    |
[01:01:32] - LL |     println!("{}", 0u32 - 1);
[01:01:32] -    |                    ^^^^^^^^ attempted to do overflowing math
[01:01:32] -
[01:01:32] - warning: constant evaluation error
[01:01:32] + warning: attempt to subtract with overflow
[01:01:32] 16   --> $DIR/promoted_errors.rs:17:14
[01:01:32] 17    |
[01:01:32] 18 LL |     let _x = 0u32 - 1;
[01:01:32]
[01:01:32] -    |              ^^^^^^^^ attempted to do overflowing math
[01:01:32] +    |              ^^^^^^^^
[01:01:32] 20
[01:01:32] 21 warning: attempt to divide by zero
[01:01:32] 22   --> $DIR/promoted_errors.rs:19:20
[01:01:32]
[01:01:32]
[01:01:32] The actual stderr differed from the expected stderr.
[01:01:32] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stderr
[01:01:32] To update references, run this command from build directory:
[01:01:32] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'const-eval/promoted_errors.rs'
[01:01:32]
[01:01:32] error: 1 errors occurred comparing output.
[01:01:32] status: exit code: 0
[01:01:32] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-eval/promoted_errors.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-Zmiri" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[01:01:32] {"message":"attempt to subtract with overflow","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":528,"byte_end":536,"line_start":14,"line_end":14,"column_start":20,"column_end":28,"is_primary":true,"text":[{"text":"    println!(\"{}\", 0u32 - 1);","highlight_start":20,"highlight_end":28}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"#[warn(const_err)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: attempt to subtract with overflow\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:14:20\n   |\nLL |     println!(\"{}\", 0u32 - 1);\n   |                    ^^^^^^^^\n   |\n   = note: #[warn(const_err)] on by default\n\n"}
[01:01:32] {"message":"attempt to subtract with overflow","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":600,"byte_end":608,"line_start":17,"line_end":17,"column_start":14,"column_end":22,"is_primary":true,"text":[{"text":"    let _x = 0u32 - 1;","highlight_start":14,"highlight_end":22}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to subtract with overflow\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:17:14\n   |\nLL |     let _x = 0u32 - 1;\n   |              ^^^^^^^^\n\n"}
[01:01:32] {"message":"attempt to divide by zero","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":653,"byte_end":660,"line_start":19,"line_end":19,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(1-1));","highlight_start":20,"highlight_end":27}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to divide by zero\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:19:20\n   |\nLL |     println!(\"{}\", 1/(1-1));\n   |                    ^^^^^^^\n\n"}
[01:01:32] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":653,"byte_end":660,"line_start":19,"line_end":19,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(1-1));","highlight_start":20,"highlight_end":27}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:19:20\n   |\nLL |     println!(\"{}\", 1/(1-1));\n   |                    ^^^^^^^ attempted to do overflowing math\n\n"}
[01:01:32] {"message":"attempt to divide by zero","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":724,"byte_end":731,"line_start":22,"line_end":22,"column_start":14,"column_end":21,"is_primary":true,"text":[{"text":"    let _x = 1/(1-1);","highlight_start":14,"highlight_end":21}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to divide by zero\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:22:14\n   |\nLL |     let _x = 1/(1-1);\n   |              ^^^^^^^\n\n"}
[01:01:32] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":724,"byte_end":731,"line_start":22,"line_end":22,"column_start":14,"column_end":21,"is_primary":true,"text":[{"text":"    let _x = 1/(1-1);","highlight_start":14,"highlight_end":21}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:22:14\n   |\nLL |     let _x = 1/(1-1);\n   |              ^^^^^^^ attempted to do overflowing math\n\n"}
[01:01:32] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":800,"byte_end":816,"line_start":25,"line_end":25,"column_start":20,"column_end":36,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(false as u32));","highlight_start":20,"highlight_end":36}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:25:20\n   |\nLL |     println!(\"{}\", 1/(false as u32));\n   |                    ^^^^^^^^^^^^^^^^ attempted to do overflowing math\n\n"}
---
[01:01:32] 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/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Zmiri -Zunstable-options " "--target-rustcflags" "-Crpath -Zmiri -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "6.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:01:32] expected success, got: exit code: 101
[01:01:32]
[01:01:32]
[01:01:32] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:01:32] Build completed unsuccessfully in 0:02:03
[01:01:32] make: *** [check] Error 1
[01:01:32] Makefile:58: recipe for target 'check' failed
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:23659e83:start=1523563422453728857,finish=1523563422460425446,duration=6696589
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:0c985fce
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:0c985fce:start=1523563422466257350,finish=1523563422473708707,duration=7451357
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:281a65d0
$ dmesg | grep -i kill
[   10.887890] init: failsafe main process (1092) killed by TERM signal

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)

@kennytm kennytm 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 13, 2018
@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 13, 2018

I cannot reproduce locally (rebased) and Travis cannot reproduce either. Not sure what's going on.

@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 15, 2018

Let's retry. We need this for beta

@bors r=eddyb

@bors
Copy link
Contributor

bors commented Apr 15, 2018

📌 Commit a406af8 has been approved by eddyb

@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 Apr 15, 2018
@bors
Copy link
Contributor

bors commented Apr 15, 2018

⌛ Testing commit a406af8 with merge e5b78d9b47703363d7af20c411b3613622ada7ec...

@bors
Copy link
Contributor

bors commented Apr 15, 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 Apr 15, 2018
@rust-highfive
Copy link
Collaborator

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:04:56] - warning: constant evaluation error
[01:04:56] + warning: attempt to subtract with overflow
[01:04:56] 2   --> $DIR/promoted_errors.rs:14:20
[01:04:56] 3    |
[01:04:56] 4 LL |     println!("{}", 0u32 - 1);
[01:04:56]
[01:04:56] -    |                    ^^^^^^^^ attempted to do overflowing math
[01:04:56] +    |                    ^^^^^^^^
[01:04:56] 6    |
[01:04:56] 7    = note: #[warn(const_err)] on by default
[01:04:56] 8
[01:04:56]
[01:04:56] - warning: constant evaluation error
[01:04:56] -   --> $DIR/promoted_errors.rs:14:20
[01:04:56] -    |
[01:04:56] - LL |     println!("{}", 0u32 - 1);
[01:04:56] -    |                    ^^^^^^^^ attempted to do overflowing math
[01:04:56] -
[01:04:56] - warning: constant evaluation error
[01:04:56] + warning: attempt to subtract with overflow
[01:04:56] 16   --> $DIR/promoted_errors.rs:17:14
[01:04:56] 17    |
[01:04:56] 18 LL |     let _x = 0u32 - 1;
[01:04:56]
[01:04:56] -    |              ^^^^^^^^ attempted to do overflowing math
[01:04:56] +    |              ^^^^^^^^
[01:04:56] 20
[01:04:56] 21 warning: attempt to divide by zero
[01:04:56] 22   --> $DIR/promoted_errors.rs:19:20
[01:04:56]
[01:04:56]
[01:04:56] The actual stderr differed from the expected stderr.
[01:04:56] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stderr
[01:04:56] To update references, run this command from build directory:
[01:04:56] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'const-eval/promoted_errors.rs'
[01:04:56]
[01:04:56] error: 1 errors occurred comparing output.
[01:04:56] status: exit code: 0
[01:04:56] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-eval/promoted_errors.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[01:04:56] {"message":"attempt to subtract with overflow","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":515,"byte_end":523,"line_start":14,"line_end":14,"column_start":20,"column_end":28,"is_primary":true,"text":[{"text":"    println!(\"{}\", 0u32 - 1);","highlight_start":20,"highlight_end":28}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"#[warn(const_err)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: attempt to subtract with overflow\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:14:20\n   |\nLL |     println!(\"{}\", 0u32 - 1);\n   |                    ^^^^^^^^\n   |\n   = note: #[warn(const_err)] on by default\n\n"}
[01:04:56] {"message":"attempt to subtract with overflow","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":587,"byte_end":595,"line_start":17,"line_end":17,"column_start":14,"column_end":22,"is_primary":true,"text":[{"text":"    let _x = 0u32 - 1;","highlight_start":14,"highlight_end":22}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to subtract with overflow\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:17:14\n   |\nLL |     let _x = 0u32 - 1;\n   |              ^^^^^^^^\n\n"}
[01:04:56] {"message":"attempt to divide by zero","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":640,"byte_end":647,"line_start":19,"line_end":19,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(1-1));","highlight_start":20,"highlight_end":27}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to divide by zero\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:19:20\n   |\nLL |     println!(\"{}\", 1/(1-1));\n   |                    ^^^^^^^\n\n"}
[01:04:56] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":640,"byte_end":647,"line_start":19,"line_end":19,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(1-1));","highlight_start":20,"highlight_end":27}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:19:20\n   |\nLL |     println!(\"{}\", 1/(1-1));\n   |                    ^^^^^^^ attempted to do overflowing math\n\n"}
[01:04:56] {"message":"attempt to divide by zero","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":711,"byte_end":718,"line_start":22,"line_end":22,"column_start":14,"column_end":21,"is_primary":true,"text":[{"text":"    let _x = 1/(1-1);","highlight_start":14,"highlight_end":21}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to divide by zero\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:22:14\n   |\nLL |     let _x = 1/(1-1);\n   |              ^^^^^^^\n\n"}
[01:04:56] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":711,"byte_end":718,"line_start":22,"line_end":22,"column_start":14,"column_end":21,"is_primary":true,"text":[{"text":"    let _x = 1/(1-1);","highlight_start":14,"highlight_end":21}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:22:14\n   |\nLL |     let _x = 1/(1-1);\n   |              ^^^^^^^ attempted to do overflowing math\n\n"}
[01:04:56] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":787,"byte_end":803,"line_start":25,"line_end":25,"column_start":20,"column_end":36,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(false as u32));","highlight_start":20,"highlight_end":36}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:25:20\n   |\nLL |     println!(\"{}\", 1/(false as u32));\n   |                    ^^^^^^^^^^^^^^^^ attempted to do overflowing math\n\n"}
---
[01:04:56] 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/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Zunstable-options " "--target-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "6.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:04:56] expected success, got: exit code: 101
[01:04:56]
[01:04:56]
[01:04:56] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:04:56] Build completed unsuccessfully in 0:02:16
[01:04:56] Makefile:58: recipe for target 'check' failed
[01:04:56] make: *** [check] Error 1
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:0567e25e:start=1523809675127277837,finish=1523809675140897733,duration=13619896
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:0b1707b2
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:0b1707b2:start=1523809675151427221,finish=1523809675158667600,duration=7240379
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:04ce05f4
$ dmesg | grep -i kill
[   10.789765] init: failsafe main process (1092) killed by TERM signal

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)

1 similar comment
@rust-highfive
Copy link
Collaborator

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:04:56] - warning: constant evaluation error
[01:04:56] + warning: attempt to subtract with overflow
[01:04:56] 2   --> $DIR/promoted_errors.rs:14:20
[01:04:56] 3    |
[01:04:56] 4 LL |     println!("{}", 0u32 - 1);
[01:04:56]
[01:04:56] -    |                    ^^^^^^^^ attempted to do overflowing math
[01:04:56] +    |                    ^^^^^^^^
[01:04:56] 6    |
[01:04:56] 7    = note: #[warn(const_err)] on by default
[01:04:56] 8
[01:04:56]
[01:04:56] - warning: constant evaluation error
[01:04:56] -   --> $DIR/promoted_errors.rs:14:20
[01:04:56] -    |
[01:04:56] - LL |     println!("{}", 0u32 - 1);
[01:04:56] -    |                    ^^^^^^^^ attempted to do overflowing math
[01:04:56] -
[01:04:56] - warning: constant evaluation error
[01:04:56] + warning: attempt to subtract with overflow
[01:04:56] 16   --> $DIR/promoted_errors.rs:17:14
[01:04:56] 17    |
[01:04:56] 18 LL |     let _x = 0u32 - 1;
[01:04:56]
[01:04:56] -    |              ^^^^^^^^ attempted to do overflowing math
[01:04:56] +    |              ^^^^^^^^
[01:04:56] 20
[01:04:56] 21 warning: attempt to divide by zero
[01:04:56] 22   --> $DIR/promoted_errors.rs:19:20
[01:04:56]
[01:04:56]
[01:04:56] The actual stderr differed from the expected stderr.
[01:04:56] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stderr
[01:04:56] To update references, run this command from build directory:
[01:04:56] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'const-eval/promoted_errors.rs'
[01:04:56]
[01:04:56] error: 1 errors occurred comparing output.
[01:04:56] status: exit code: 0
[01:04:56] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-eval/promoted_errors.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-eval/promoted_errors.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[01:04:56] {"message":"attempt to subtract with overflow","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":515,"byte_end":523,"line_start":14,"line_end":14,"column_start":20,"column_end":28,"is_primary":true,"text":[{"text":"    println!(\"{}\", 0u32 - 1);","highlight_start":20,"highlight_end":28}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"#[warn(const_err)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: attempt to subtract with overflow\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:14:20\n   |\nLL |     println!(\"{}\", 0u32 - 1);\n   |                    ^^^^^^^^\n   |\n   = note: #[warn(const_err)] on by default\n\n"}
[01:04:56] {"message":"attempt to subtract with overflow","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":587,"byte_end":595,"line_start":17,"line_end":17,"column_start":14,"column_end":22,"is_primary":true,"text":[{"text":"    let _x = 0u32 - 1;","highlight_start":14,"highlight_end":22}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to subtract with overflow\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:17:14\n   |\nLL |     let _x = 0u32 - 1;\n   |              ^^^^^^^^\n\n"}
[01:04:56] {"message":"attempt to divide by zero","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":640,"byte_end":647,"line_start":19,"line_end":19,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(1-1));","highlight_start":20,"highlight_end":27}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to divide by zero\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:19:20\n   |\nLL |     println!(\"{}\", 1/(1-1));\n   |                    ^^^^^^^\n\n"}
[01:04:56] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":640,"byte_end":647,"line_start":19,"line_end":19,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(1-1));","highlight_start":20,"highlight_end":27}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:19:20\n   |\nLL |     println!(\"{}\", 1/(1-1));\n   |                    ^^^^^^^ attempted to do overflowing math\n\n"}
[01:04:56] {"message":"attempt to divide by zero","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":711,"byte_end":718,"line_start":22,"line_end":22,"column_start":14,"column_end":21,"is_primary":true,"text":[{"text":"    let _x = 1/(1-1);","highlight_start":14,"highlight_end":21}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: attempt to divide by zero\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:22:14\n   |\nLL |     let _x = 1/(1-1);\n   |              ^^^^^^^\n\n"}
[01:04:56] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":711,"byte_end":718,"line_start":22,"line_end":22,"column_start":14,"column_end":21,"is_primary":true,"text":[{"text":"    let _x = 1/(1-1);","highlight_start":14,"highlight_end":21}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:22:14\n   |\nLL |     let _x = 1/(1-1);\n   |              ^^^^^^^ attempted to do overflowing math\n\n"}
[01:04:56] {"message":"constant evaluation error","code":{"code":"const_err","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/const-eval/promoted_errors.rs","byte_start":787,"byte_end":803,"line_start":25,"line_end":25,"column_start":20,"column_end":36,"is_primary":true,"text":[{"text":"    println!(\"{}\", 1/(false as u32));","highlight_start":20,"highlight_end":36}],"label":"attempted to do overflowing math","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: constant evaluation error\n  --> /checkout/src/test/ui/const-eval/promoted_errors.rs:25:20\n   |\nLL |     println!(\"{}\", 1/(false as u32));\n   |                    ^^^^^^^^^^^^^^^^ attempted to do overflowing math\n\n"}
---
[01:04:56] 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/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Zunstable-options " "--target-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "6.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:04:56] expected success, got: exit code: 101
[01:04:56]
[01:04:56]
[01:04:56] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:04:56] Build completed unsuccessfully in 0:02:16
[01:04:56] Makefile:58: recipe for target 'check' failed
[01:04:56] make: *** [check] Error 1
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:0567e25e:start=1523809675127277837,finish=1523809675140897733,duration=13619896
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:0b1707b2
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:0b1707b2:start=1523809675151427221,finish=1523809675158667600,duration=7240379
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:04ce05f4
$ dmesg | grep -i kill
[   10.789765] init: failsafe main process (1092) killed by TERM signal

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)

@kennytm kennytm 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 15, 2018
@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 16, 2018

So... it looks like this is due to optimization levels changing the output. (only happens on the noopt builder)

Since the runtime behaviour would also differ (panic/no-panic), is it fine if the diagnostics differ? I'd just mark the test as always running with optimizations

@nagisa nagisa added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 20, 2018
@alexcrichton
Copy link
Member

Hey wanted to circle back to this as it's beta-nominated and wanted to make sure it landed in a timely fashion for the next release, @oli-obk was that last question all that's blocking this? I'd imagine that for fixing a regression that such behavior is probably fine for now.

The error messages differ between optimized and nonoptimized mode
@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 23, 2018

@bors r=eddyb

@bors
Copy link
Contributor

bors commented Apr 23, 2018

📌 Commit bb367c4 has been approved by eddyb

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 23, 2018
@bors
Copy link
Contributor

bors commented Apr 23, 2018

⌛ Testing commit bb367c4 with merge 725c9b0...

bors added a commit that referenced this pull request Apr 23, 2018
Don't report compile-time errors for promoteds

Fixes the regression part of #49760, the missing warnings still are missing

r? @eddyb
@bors
Copy link
Contributor

bors commented Apr 24, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 725c9b0 to master...

@bors bors merged commit bb367c4 into rust-lang:master Apr 24, 2018
@oli-obk oli-obk deleted the const_err_regression branch April 24, 2018 14:10
@alexcrichton alexcrichton added beta-accepted Accepted for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Apr 25, 2018
bors added a commit that referenced this pull request Apr 25, 2018
[beta] Process backports

* #49779: Don't report compile-time errors for promoteds
* #50110: Warn on all erroneous constants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants