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

[beta] Unstable const fn promotion #51040

Merged
merged 3 commits into from
May 25, 2018

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented May 24, 2018

@rust-highfive
Copy link
Collaborator

warning Warning warning

  • Pull requests are usually filed against the master branch for this repo, but this one is against beta. Please double check that you specified the right target!

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 24, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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.
Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:46:40] 
[00:46:40] running 1388 tests
[00:46:45] ..................................................................................i.................
[00:46:51] .............F..................i...................................................................
[00:46:58] ....................................................................................................
[00:47:02] ....................................................................................................
[00:47:05] ....................................................................................................
[00:47:11] ....................................................................................................
---
[00:47:53] ---- [ui] ui/const-eval/dont_promote_unstable_const_fn.rs stdout ----
[00:47:53]  diff of stderr:
[00:47:53] 
[00:47:53] 27    |
[00:47:53] 28    = note: borrowed value must be valid for the static lifetime...
[00:47:53] - error: aborting due to 3 previous errors
[00:47:53] - error: aborting due to 3 previous errors
[00:47:53] + error[E0597]: borrowed value does not live long enough
[00:47:53] +   --> $DIR/dont_promote_unstable_const_fn.rs:33:26
[00:47:53] +    |
[00:47:53] + LL |     let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();
[00:47:53] +    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
[00:47:53] + LL | }
[00:47:53] +    | - temporary value only lives until here
[00:47:53] +    |
[00:47:53] +    = note: borrowed value must be valid for the static lifetime...
[00:47:53] + error: aborting due to 4 previous errors
[00:47:53] 31 
[00:47:53] 32 For more information about this error, try `rustc --explain E0597`.
[00:47:53] 33 
---
[00:47:53] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'const-eval/dont_promote_unstable_const_fn.rs'
[00:47:53] 
[00:47:53] error: 1 errors occurred comparing output.
[00:47:53] status: exit code: 101
[00:47:53] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.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/dont_promote_unstable_const_fn.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-O" "-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/dont_promote_unstable_const_fn.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
[00:47:53] ------------------------------------------
[00:47:53] 
[00:47:53] ------------------------------------------
[00:47:53] stderr:
[00:47:53] stderr:
[00:47:53] ------------------------------------------
[00:47:53] {"message":"`foo` is not yet stable as a const fn","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs","byte_start":867,"byte_end":872,"line_start":25,"line_end":25,"column_start":25,"column_end":30,"is_primary":true,"text":[{"text":"const fn bar() -> u32 { foo() } //~ ERROR `foo` is not yet stable as a const fn","highlight_start":25,"highlight_end":30}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"in Nightly builds, add `#![feature(foo)]` to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `foo` is not yet stable as a const fn\n  --> /checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs:25:25\n   |\nLL | const fn bar() -> u32 { foo() } //~ ERROR `foo` is not yet stable as a const fn\n   |                         ^^^^^\n   |\n   = help: in Nightly builds, add `#![feature(foo)]` to the crate attributes to enable\n\n"}
[00:47:53] {"message":"borrowed value does not live long enough","code":{"code":"E0597","explanation":"\nThis error occurs because a borrow was made inside a variable which has a\ngreater lifetime than the borrowed one.\n\nExample of erroneous code:\n\n```compile_fail,E0597\nstruct Foo<'a> {\n    x: Option<&'a u32>,\n}\n\nlet mut x = Foo { x: None };\nlet y = 0;\nx.x = Some(&y); // error: `y` does not live long enough\n```\n\nIn here, `x` is created before `y` and therefore has a greater lifetime. Always\nkeep in mind that values in a scope are dropped in the opposite order they are\ncreated. So to fix the previous example, just make the `y` lifetime greater than\nthe `x`'s one:\n\n```\nstruct Foo<'a> {\n    x: Option<&'a u32>,\n}\n\nlet y = 0;\nlet mut x = Foo { x: None };\nx.x = Some(&y);\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs","byte_start":960,"byte_end":965,"line_start":28,"line_end":28,"column_start":28,"column_end":33,"is_primary":true,"text":[{"text":"    let _: &'static u32 = &foo(); //~ ERROR does not live long enough","highlight_start":28,"highlight_end":33}],"label":"temporary value does not live long enough","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs","byte_start":1003,"byte_end":1004,"line_start":29,"line_end":29,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"}","highlight_start":1,"highlight_end":2}],"label":"temporary value only lives until here","suggested_replacement":null,"expansion":null}],"children":[{"message":"borrowed value must be valid for the static lifetime...","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0597]: borrowed value does not live long enough\n  --> /checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs:28:28\n   |\nLL |     le:1168,"line_start":34,"line_end":34,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"}","highlight_start":1,"highlight_end":2}],"label":"temporary value only lives until here","suggested_replacement":null,"expansion":null}],"children":[{"message":"borrowed value must be valid for the static lifetime...","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0597]: borrowed value does not live long enough\n  --> /checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs:32:28\n   |\nLL |     let _: &'static u32 = &meh(); //~ ERROR does not live long enough\n   |                            ^^^^^ temporary value does not live long enough\nLL |     let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();\nLL | }\n   | - temporary value only lives until here\n   |\n   = note: borrowed value must be valid for the static lifetime...\n\n"}
[00:47:53] {"message":"borrowed value does not live long enough","code":{"code":"E0597","explanation":"\nThis error occurs because a borrow was made inside a variable which has a\ngreater lifetime than the borrowed one.\n\nExample of erroneous code:\n\n```compile_fail,E0597\nstruct Foo<'a> {\n    x: Option<&'a u32>,\n}\n\nlet mut x = Foo { x: None };\nlet y = 0;\nx.x = Some(&y); // error: `y` does not live long enough\n```\n\nIn here, `x` is created before `y` and therefore has a greater lifetime. Always\nkeep in mind that values in a scope are dropped in the opposite order they are\ncreated. So to fix the previous example, just make the `y` lifetime greater than\nthe `x`'s one:\n\n```\nstruct Foo<'a> {\n    x: Option<&'a u32>,\n}\n\nlet y = 0;\nlet mut x = Foo { x: None };\nx.x = Some(&y);\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs","byte_start":1113,"byte_end":1165,"line_start":33,"line_end":33,"column_start":26,"column_end":78,"is_primary":true,"text":[{"text":"    let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();","highlight_start":26,"highlight_end":78}],"label":"temporary value does not live long enough","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs","byte_start":1167,"byte_end":1168,"line_start":34,"line_end":34,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"}","highlight_start":1,"highlight_end":2}],"label":"temporary value only lives until here","suggested_replacement":null,"expansion":null}],"children":[{"message":"borrowed value must be valid for the static lifetime...","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0597]: borrowed value does not live long enough\n  --> /checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs:33:26\n   |\nLL |     let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();\n   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough\nLL | }\n   | - temporary value only lives until here\n   |\n   = note: borrowed value must be valid for the static lifetime...\n\n"}
[00:47:53] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[00:47:53] {"message":"For more information about this error, try `rustc --explain E0597`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0597`.\n"}
[00:47:53] ------------------------------------------
[00:47:53] 
[00:47:53] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:492:22
[00:47:53] thread '[ui] ui/const-eval/dont_promote_unstable_const_fn.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3033:9
---
[00:47:53] test result: FAILED. 1380 passed; 1 failed; 7 ignored; 0 measured; 0 filtered out
[00:47:53] 
[00:47:53] 
[00:47:53] 
[00:47:53] 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 -Zunstable-options " "--target-rustcflags" "-Crpath -O -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:47:53] 
[00:47:53] 
[00:47:53] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:47:53] Build completed unsuccessfully in 0:02:30
[00:47:53] Build completed unsuccessfully in 0:02:30
[00:47:53] Makefile:58: recipe for target 'check' failed
[00:47:53] make: *** [check] Error 1
2728572 ./obj
2728540 ./obj/build
1965008 ./obj/build/x86_64-unknown-linux-gnu
927472 ./.git
---
149560 ./.git/modules
149556 ./.git/modules/src
149112 ./src/llvm-emscripten/test
123932 ./obj/build/bootstrap/debug/incremental/bootstrap-368kjpmz08h8o
123928 ./obj/build/bootstrap/debug/incremental/bootstrap-368kjpmz08h8o/s-f1cct4tn4t-shn094-a5eqdv1qeuis
112612 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu
112608 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release
108616 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps
103440 ./obj/build/bootstrap/debug/incremental/bootstrap-152hben4kxal2
103440 ./obj/build/bootstrap/debug/incremental/bootstrap-152hben4kxal2
103436 ./obj/build/bootstrap/debug/incremental/bootstrap-152hben4kxal2/s-f1cdzfipci-13aqc0b-18d35k9c9hp7o
98488 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental
93352 ./obj/build/x86_64-unknown-linux-gnu/stage1
93328 ./obj/build/x86_64-unknown-linux-gnu/stage1/lib
90856 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz
90856 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz
90852 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz/s-f1cdwzhutq-z3j9ws-ek2w5d5pqxih
87768 ./obj/build/x86_64-unknown-linux-gnu/doc/core
81228 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps
80932 ./obj/build/x86_64-unknown-linux-gnu/doc/std
79028 ./obj/build/x86_64-unknown-linux-gnu/stage0-sysroot

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 May 24, 2018
@pietroalbini
Copy link
Member

r=me, I don't have review permissions on bors though.

@oli-obk
Copy link
Contributor Author

oli-obk commented May 25, 2018

@bors r=pietroalbini

@bors
Copy link
Contributor

bors commented May 25, 2018

📌 Commit 5d55459 has been approved by pietroalbini

@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 May 25, 2018
@oli-obk
Copy link
Contributor Author

oli-obk commented May 25, 2018

@bors p=1 (beta backport)

@bors
Copy link
Contributor

bors commented May 25, 2018

⌛ Testing commit 5d55459 with merge 71d395a3e596409f88e24e5633ffad794eea91db...

@bors
Copy link
Contributor

bors commented May 25, 2018

💔 Test failed - status-appveyor

@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 May 25, 2018
@kennytm
Copy link
Member

kennytm commented May 25, 2018

@bors retry #50604

[00:32:34] [RUSTC-TIMING] syntax_ext test:false 22.340
[00:35:11] [RUSTC-TIMING] rustc test:false 178.794
[00:35:11] error: Could not compile `rustc`.
[00:35:11] 
[00:35:11] Caused by:
[00:35:11]   process didn't exit successfully: `C:\projects\rust\build\bootstrap/debug/rustc --crate-name rustc librustc\lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C metadata=d3200e9bbf160765 -C extra-filename=-d3200e9bbf160765 --out-dir C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps --target i686-pc-windows-msvc -L dependency=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps -L dependency=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\release\deps --extern log=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\liblog-2762c5caac82e417.rlib --extern rustc_target=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\rustc_target-05ddd24e760f7ace.dll --extern flate2=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\libflate2-94f78f7f57f2889d.rlib --extern tempdir=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\libtempdir-d420b445b9e14a91.rlib --extern rustc_data_structures=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\rustc_data_structures-ada7e2259a28d058.dll --extern backtrace=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\libbacktrace-8e3f073373aa2bb2.rlib --extern syntax=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\syntax-a13425ea467ee748.dll --extern proc_macro=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\proc_macro-fc17a52941a7f029.dll --extern arena=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\arena-b483733d2ccbf5e3.dll --extern bitflags=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\libbitflags-61e76ec1dd633d3a.rlib --extern rustc_errors=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\rustc_errors-bbc2087b6b278c3c.dll --extern serialize=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\serialize-7aaabfe06ab6d124.dll --extern serialize=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\libserialize-7aaabfe06ab6d124.rlib --extern byteorder=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\libbyteorder-71611757d6cec2d5.rlib --extern lazy_static=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\liblazy_static-765850a4e6bed16a.rlib --extern graphviz=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\graphviz-0d8356d8e0b0ba02.dll --extern syntax_pos=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\syntax_pos-9ad18d15aa741028.dll --extern jobserver=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\libjobserver-9e74702d9fded34b.rlib --extern rustc_apfloat=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\librustc_apfloat-055be6a6ca7a7943.rlib --extern fmt_macros=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\deps\fmt_macros-440f172084320323.dll -L native=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\lib\ -L native=C:\projects\rust\build\i686-pc-windows-msvc\stage1-rustc\i686-pc-windows-msvc\release\build\miniz-sys-d6e994b7a05d8bcc\out` (exit code: 3221225477)
[00:35:11] command did not execute successfully: "C:\\projects\\rust\\build\\i686-pc-windows-msvc\\stage0/bin\\cargo.exe" "build" "--target" "i686-pc-windows-msvc" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "C:\\projects\\rust\\src/rustc/Cargo.toml" "--message-format" "json"
[00:35:11] expected success, got: exit code: 101
[00:35:11] thread 'main' panicked at 'cargo must succeed', bootstrap\compile.rs:1091:9
[00:35:11] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:35:11] failed to run: C:\projects\rust\build\bootstrap\debug\bootstrap dist
[00:35:11] Build completed unsuccessfully in 0:29:31
[00:35:11] Command exited with code 1

@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 May 25, 2018
@bors
Copy link
Contributor

bors commented May 25, 2018

⌛ Testing commit 5d55459 with merge b69d1d4...

bors added a commit that referenced this pull request May 25, 2018
…etroalbini

[beta] Unstable const fn promotion

r? @pietroalbini
@bors
Copy link
Contributor

bors commented May 25, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: pietroalbini
Pushing b69d1d4 to beta...

@bors bors merged commit 5d55459 into rust-lang:beta May 25, 2018
@oli-obk oli-obk deleted the unstable_const_fn_promotion_beta branch June 15, 2020 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants