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

Add memoization for const function evaluations #66294

Merged
merged 2 commits into from
Nov 28, 2019

Conversation

davidhewitt
Copy link
Contributor

When a const function is being evaluated, as long as all its arguments are zero-sized-types (or it has no arguments) then we can trivially memoize the evaluation result using the existing query mechanism.

With thanks to @oli-obk for mentoring me through this at RustFest Barcelona.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 11, 2019
@oli-obk
Copy link
Contributor

oli-obk commented Nov 11, 2019

@bors try

@bors
Copy link
Contributor

bors commented Nov 11, 2019

⌛ Trying commit 30cef9b with merge 29354cb...

bors added a commit that referenced this pull request Nov 11, 2019
Add memoization for const function evaluations

When a const function is being evaluated, as long as all its arguments are zero-sized-types (or it has no arguments) then we can trivially memoize the evaluation result using the existing query mechanism.

With thanks to @oli-obk for mentoring me through this at RustFest Barcelona.

r? @oli-obk
@oli-obk
Copy link
Contributor

oli-obk commented Nov 11, 2019

@rust-timer build 29354cb

@rust-timer
Copy link
Collaborator

Queued 29354cb with parent 9248b01, future comparison URL.

src/librustc_mir/interpret/terminator.rs Outdated Show resolved Hide resolved
src/librustc_mir/interpret/terminator.rs Outdated Show resolved Hide resolved
src/librustc_mir/interpret/terminator.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-11-11T14:38:00.9124786Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-11T14:38:00.9334675Z ##[command]git config gc.auto 0
2019-11-11T14:38:00.9415612Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-11T14:38:00.9479280Z ##[command]git config --get-all http.proxy
2019-11-11T14:38:00.9621373Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66294/merge:refs/remotes/pull/66294/merge
---
2019-11-11T15:38:12.2153516Z .................................................................................................... 1400/9228
2019-11-11T15:38:18.6368475Z .................................................................................................... 1500/9228
2019-11-11T15:38:24.7475845Z ..................................F................................................................. 1600/9228
2019-11-11T15:38:33.9951580Z ....................................................................F............................... 1700/9228
2019-11-11T15:38:42.5181127Z ..i................................................................................................. 1800/9228
2019-11-11T15:38:49.5112675Z ......................................................................................iiiii......... 1900/9228
2019-11-11T15:39:11.0005174Z .................................................................................................... 2100/9228
2019-11-11T15:39:13.3625620Z .................................................................................................... 2200/9228
2019-11-11T15:39:16.3709915Z .................................................................................................... 2300/9228
2019-11-11T15:39:26.2193253Z .................................................................................................... 2400/9228
---
2019-11-11T15:42:19.4663757Z ..................................................................................i...............i. 4700/9228
2019-11-11T15:42:26.4144128Z .................................................................................................... 4800/9228
2019-11-11T15:42:35.6922243Z .................................................................................................... 4900/9228
2019-11-11T15:42:40.9710589Z .................................................................................................... 5000/9228
2019-11-11T15:42:52.5323474Z .....................................................................................ii.ii.......... 5100/9228
2019-11-11T15:42:56.2484369Z .i.................................................................................................. 5200/9228
2019-11-11T15:43:10.9477182Z .................................................................................................... 5400/9228
2019-11-11T15:43:17.9755307Z ...................................................................i................................ 5500/9228
2019-11-11T15:43:25.3837449Z .................................................................................................... 5600/9228
2019-11-11T15:43:33.2114753Z .................................................................................................... 5700/9228
2019-11-11T15:43:33.2114753Z .................................................................................................... 5700/9228
2019-11-11T15:43:42.3649339Z ....................................................ii...i..ii...........i.......................... 5800/9228
2019-11-11T15:44:05.2088149Z .................................................................................................... 6000/9228
2019-11-11T15:44:13.5442262Z .................................................................................................... 6100/9228
2019-11-11T15:44:13.5442262Z .................................................................................................... 6100/9228
2019-11-11T15:44:18.5742879Z .......................................................................i..ii........................ 6200/9228
2019-11-11T15:44:47.8929435Z .................................................................................................... 6400/9228
2019-11-11T15:44:50.0915527Z .......................................i............................................................ 6500/9228
2019-11-11T15:44:52.3625454Z .................................................................................................... 6600/9228
2019-11-11T15:44:54.7731281Z .......................i............................................................................ 6700/9228
---
2019-11-11T15:49:43.7304139Z 
2019-11-11T15:49:43.7304942Z ---- [ui] ui/consts/const-size_of-cycle.rs stdout ----
2019-11-11T15:49:43.7305241Z diff of stderr:
2019-11-11T15:49:43.7305423Z 
2019-11-11T15:49:43.7305640Z 10 LL |     bytes: [u8; std::mem::size_of::<Foo>()]
2019-11-11T15:49:43.7305832Z 11    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7306391Z 12 note: ...which requires const-evaluating `Foo::bytes::{{constant}}#0`...
2019-11-11T15:49:43.7306958Z +   --> $DIR/const-size_of-cycle.rs:5:17
2019-11-11T15:49:43.7307415Z +    |
2019-11-11T15:49:43.7307506Z + LL |     bytes: [u8; std::mem::size_of::<Foo>()]
2019-11-11T15:49:43.7307590Z +    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7309840Z + note: ...which requires const-evaluating `std::mem::size_of`...
2019-11-11T15:49:43.7310638Z 13   --> $SRC_DIR/libcore/mem/mod.rs:LL:COL
2019-11-11T15:49:43.7310872Z 15 LL |     intrinsics::size_of::<T>()
2019-11-11T15:49:43.7310922Z 
2019-11-11T15:49:43.7310950Z 
2019-11-11T15:49:43.7310995Z The actual stderr differed from the expected stderr.
2019-11-11T15:49:43.7310995Z The actual stderr differed from the expected stderr.
2019-11-11T15:49:43.7311355Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-size_of-cycle/const-size_of-cycle.stderr
2019-11-11T15:49:43.7311637Z To update references, rerun the tests and pass the `--bless` flag
2019-11-11T15:49:43.7311906Z To only update this specific test, also pass `--test-args consts/const-size_of-cycle.rs`
2019-11-11T15:49:43.7312005Z error: 1 errors occurred comparing output.
2019-11-11T15:49:43.7312050Z status: exit code: 1
2019-11-11T15:49:43.7312050Z status: exit code: 1
2019-11-11T15:49:43.7312825Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/const-size_of-cycle.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-size_of-cycle" "-Crpath" "-O" "-Cdebuginfo=0" "-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/consts/const-size_of-cycle/auxiliary" "-A" "unused"
2019-11-11T15:49:43.7313171Z ------------------------------------------
2019-11-11T15:49:43.7313221Z 
2019-11-11T15:49:43.7313760Z ------------------------------------------
2019-11-11T15:49:43.7313815Z stderr:
2019-11-11T15:49:43.7313815Z stderr:
2019-11-11T15:49:43.7314046Z ------------------------------------------
2019-11-11T15:49:43.7314318Z error[E0391]: cycle detected when const-evaluating + checking `Foo::bytes::{{constant}}#0`
2019-11-11T15:49:43.7314651Z    |
2019-11-11T15:49:43.7314651Z    |
2019-11-11T15:49:43.7314697Z LL |     bytes: [u8; std::mem::size_of::<Foo>()]
2019-11-11T15:49:43.7314801Z    |
2019-11-11T15:49:43.7314801Z    |
2019-11-11T15:49:43.7315062Z note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}#0`...
2019-11-11T15:49:43.7315350Z    |
2019-11-11T15:49:43.7315350Z    |
2019-11-11T15:49:43.7315409Z LL |     bytes: [u8; std::mem::size_of::<Foo>()]
2019-11-11T15:49:43.7315456Z    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7315707Z note: ...which requires const-evaluating `Foo::bytes::{{constant}}#0`...
2019-11-11T15:49:43.7316009Z    |
2019-11-11T15:49:43.7316009Z    |
2019-11-11T15:49:43.7316052Z LL |     bytes: [u8; std::mem::size_of::<Foo>()]
2019-11-11T15:49:43.7316114Z    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7316670Z note: ...which requires const-evaluating `std::mem::size_of`...
2019-11-11T15:49:43.7316989Z    |
2019-11-11T15:49:43.7317032Z LL |     intrinsics::size_of::<T>()
2019-11-11T15:49:43.7317077Z    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7317077Z    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7317349Z note: ...which requires const-evaluating + checking `std::intrinsics::size_of`...
2019-11-11T15:49:43.7317624Z    |
2019-11-11T15:49:43.7317624Z    |
2019-11-11T15:49:43.7317828Z LL |     pub fn size_of<T>() -> usize;
2019-11-11T15:49:43.7317892Z    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7317941Z    = note: ...which requires computing layout of `Foo`...
2019-11-11T15:49:43.7318001Z    = note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`...
2019-11-11T15:49:43.7318333Z    = note: ...which again requires const-evaluating + checking `Foo::bytes::{{constant}}#0`, completing the cycle
2019-11-11T15:49:43.7318399Z note: cycle used when processing `Foo`
2019-11-11T15:49:43.7318698Z    |
2019-11-11T15:49:43.7318739Z LL | struct Foo {
2019-11-11T15:49:43.7318781Z    | ^^^^^^^^^^
2019-11-11T15:49:43.7318827Z 
---
2019-11-11T15:49:43.7319456Z 
2019-11-11T15:49:43.7319703Z ---- [ui] ui/consts/uninhabited-const-issue-61744.rs stdout ----
2019-11-11T15:49:43.7319752Z diff of stderr:
2019-11-11T15:49:43.7319779Z 
2019-11-11T15:49:43.7320000Z - error: any use of this value will cause an error
2019-11-11T15:49:43.7320286Z + error[E0391]: cycle detected when const-evaluating `hint_unreachable`
2019-11-11T15:49:43.7320515Z +   --> $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7320618Z + LL |     fake_type()
2019-11-11T15:49:43.7320661Z +    |     ^^^^^^^^^^^
2019-11-11T15:49:43.7320702Z +    |
2019-11-11T15:49:43.7320702Z +    |
2019-11-11T15:49:43.7320931Z + note: ...which requires const-evaluating `fake_type`...
2019-11-11T15:49:43.7321177Z 2   --> $DIR/uninhabited-const-issue-61744.rs:4:5
2019-11-11T15:49:43.7321264Z 4 LL |     hint_unreachable()
2019-11-11T15:49:43.7321308Z 
2019-11-11T15:49:43.7321350Z 5    |     ^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7321536Z -    |     |
2019-11-11T15:49:43.7321536Z -    |     |
2019-11-11T15:49:43.7321770Z -    |     reached the configured maximum number of stack frames
2019-11-11T15:49:43.7322057Z -    |     inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
2019-11-11T15:49:43.7322321Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7322603Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7322889Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7323149Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7323737Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7324456Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7324787Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7325069Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7325338Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7325732Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7326120Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7326388Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7326650Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7326926Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7327193Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7327454Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7327731Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7327995Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7328267Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7328562Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7328824Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7329085Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7329368Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7329629Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7329889Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7330171Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7330433Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7330716Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7331002Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7331263Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7331525Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7331807Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7332068Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7332329Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7332611Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7332873Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7333173Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7333759Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7334030Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7334312Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7334579Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7334839Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7335116Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7335381Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7335748Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7336119Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7336386Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7336647Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7336925Z -    |     inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7337198Z -    |     inside call to `fake_type::<i32>` at $DIR/uninhabited-const-issue-61744.rs:12:36
2019-11-11T15:49:43.7337379Z - ...
2019-11-11T15:49:43.7337778Z - LL |     const CONSTANT: i32 = unsafe { fake_type() };
2019-11-11T15:49:43.7338010Z -    |     ---------------------------------------------
2019-11-11T15:49:43.7338276Z +    = note: ...which again requires const-evaluating `hint_unreachable`, completing the cycle
2019-11-11T15:49:43.7338524Z + note: cycle used when const-evaluating `fake_type`
2019-11-11T15:49:43.7338770Z +   --> $DIR/uninhabited-const-issue-61744.rs:4:5
2019-11-11T15:49:43.7339055Z -    = note: `#[deny(const_err)]` on by default
2019-11-11T15:49:43.7339104Z + LL |     hint_unreachable()
2019-11-11T15:49:43.7339147Z +    |     ^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7339187Z 64 
2019-11-11T15:49:43.7339187Z 64 
2019-11-11T15:49:43.7339419Z - error[E0080]: erroneous constant used
2019-11-11T15:49:43.7339643Z -   --> $DIR/uninhabited-const-issue-61744.rs:18:10
2019-11-11T15:49:43.7339858Z -    |
2019-11-11T15:49:43.7340104Z - LL |     dbg!(i32::CONSTANT);
2019-11-11T15:49:43.7340359Z -    |          ^^^^^^^^^^^^^ referenced constant has errors
2019-11-11T15:49:43.7340472Z 70 
2019-11-11T15:49:43.7340711Z - error: aborting due to 2 previous errors
2019-11-11T15:49:43.7340903Z - 
2019-11-11T15:49:43.7341164Z - For more information about this error, try `rustc --explain E0080`.
2019-11-11T15:49:43.7341164Z - For more information about this error, try `rustc --explain E0080`.
2019-11-11T15:49:43.7341474Z + For more information about this error, try `rustc --explain E0391`.
2019-11-11T15:49:43.7341524Z 74 
2019-11-11T15:49:43.7341554Z 
2019-11-11T15:49:43.7341582Z 
2019-11-11T15:49:43.7341646Z The actual stderr differed from the expected stderr.
2019-11-11T15:49:43.7342002Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/uninhabited-const-issue-61744/uninhabited-const-issue-61744.stderr
2019-11-11T15:49:43.7342269Z To update references, rerun the tests and pass the `--bless` flag
2019-11-11T15:49:43.7342588Z To only update this specific test, also pass `--test-args consts/uninhabited-const-issue-61744.rs`
2019-11-11T15:49:43.7342671Z error: 1 errors occurred comparing output.
2019-11-11T15:49:43.7342734Z status: exit code: 1
2019-11-11T15:49:43.7342734Z status: exit code: 1
2019-11-11T15:49:43.7343812Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/uninhabited-const-issue-61744" "-Crpath" "-O" "-Cdebuginfo=0" "-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/consts/uninhabited-const-issue-61744/auxiliary" "-A" "unused"
2019-11-11T15:49:43.7344217Z ------------------------------------------
2019-11-11T15:49:43.7344254Z 
2019-11-11T15:49:43.7344489Z ------------------------------------------
2019-11-11T15:49:43.7344534Z stderr:
2019-11-11T15:49:43.7344534Z stderr:
2019-11-11T15:49:43.7344746Z ------------------------------------------
2019-11-11T15:49:43.7345004Z error[E0391]: cycle detected when const-evaluating `hint_unreachable`
2019-11-11T15:49:43.7345261Z   --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
2019-11-11T15:49:43.7345368Z LL |     fake_type()
2019-11-11T15:49:43.7345583Z    |     ^^^^^^^^^^^
2019-11-11T15:49:43.7345628Z    |
2019-11-11T15:49:43.7345628Z    |
2019-11-11T15:49:43.7345890Z note: ...which requires const-evaluating `fake_type`...
2019-11-11T15:49:43.7346159Z   --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:4:5
2019-11-11T15:49:43.7346206Z    |
2019-11-11T15:49:43.7346254Z LL |     hint_unreachable() //~ ERROR any use of this value will cause an error
2019-11-11T15:49:43.7346319Z    |     ^^^^^^^^^^^^^^^^^^
2019-11-11T15:49:43.7346584Z    = note: ...which again requires const-evaluating `hint_unreachable`, completing the cycle
2019-11-11T15:49:43.7346815Z note: cycle used when const-evaluating `fake_type`
2019-11-11T15:49:43.7347086Z   --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:4:5
2019-11-11T15:49:43.7347133Z    |
2019-11-11T15:49:43.7347181Z LL |     hint_unreachable() //~ ERROR any use of this value will cause an error
2019-11-11T15:49:43.7348854Z 
2019-11-11T15:49:43.7349121Z error: aborting due to previous error
2019-11-11T15:49:43.7349156Z 
2019-11-11T15:49:43.7351900Z For more information about this error, try `rustc --explain E0391`.
---
2019-11-11T15:49:43.7359161Z - error[E0080]: evaluation of constant value failed
2019-11-11T15:49:43.7359733Z + error[E0391]: cycle detected when const-evaluating `a`
2019-11-11T15:49:43.7359975Z 2   --> $DIR/infinite-recursion-const-fn.rs:3:25
2019-11-11T15:49:43.7360044Z 3    |
2019-11-11T15:49:43.7360259Z 4 LL | const fn a() -> usize { b() }
2019-11-11T15:49:43.7360334Z 5    |                         ^^^
2019-11-11T15:49:43.7360552Z -    |                         |
2019-11-11T15:49:43.7360842Z -    |                         reached the configured maximum number of stack frames
2019-11-11T15:49:43.7360842Z -    |                         reached the configured maximum number of stack frames
2019-11-11T15:49:43.7361115Z -    |                         inside call to `b` at $DIR/infinite-recursion-const-fn.rs:3:25
2019-11-11T15:49:43.7361179Z +    |
2019-11-11T15:49:43.7361403Z + note: ...which requires const-evaluating `b`...
2019-11-11T15:49:43.7361625Z +   --> $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-11T15:49:43.7361669Z +    |
2019-11-11T15:49:43.7361896Z 9 LL | const fn b() -> usize { a() }
2019-11-11T15:49:43.7362304Z -    |                         |
2019-11-11T15:49:43.7362587Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-11T15:49:43.7362857Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-11T15:49:43.7363128Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
---
2019-11-11T15:49:43.7385102Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-11T15:49:43.7385373Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-11T15:49:43.7385639Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-11T15:49:43.7385712Z +    |                         ^^^
2019-11-11T15:49:43.7385965Z +    = note: ...which again requires const-evaluating `a`, completing the cycle
2019-11-11T15:49:43.7386204Z + note: cycle used when const-evaluating `ARR::{{constant}}#0`
2019-11-11T15:49:43.7386452Z +   --> $DIR/infinite-recursion-const-fn.rs:5:18
2019-11-11T15:49:43.7386499Z +    |
2019-11-11T15:49:43.7386543Z 61 LL | const ARR: [i32; a()] = [5; 6];
2019-11-11T15:49:43.7386834Z -    |                  --- inside call to `a` at $DIR/infinite-recursion-const-fn.rs:5:18
2019-11-11T15:49:43.7386935Z 63 
2019-11-11T15:49:43.7386994Z 64 error: aborting due to previous error
2019-11-11T15:49:43.7387036Z 65 
2019-11-11T15:49:43.7387064Z 
2019-11-11T15:49:43.7387064Z 
2019-11-11T15:49:43.7387313Z - For more information about this error, try `rustc --explain E0080`.
2019-11-11T15:49:43.7387576Z + For more information about this error, try `rustc --explain E0391`.
2019-11-11T15:49:43.7387622Z 67 
2019-11-11T15:49:43.7387647Z 
2019-11-11T15:49:43.7387673Z 
2019-11-11T15:49:43.7387734Z The actual stderr differed from the expected stderr.
2019-11-11T15:49:43.7388058Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/infinite/infinite-recursion-const-fn/infinite-recursion-const-fn.stderr
2019-11-11T15:49:43.7388307Z To update references, rerun the tests and pass the `--bless` flag
2019-11-11T15:49:43.7388613Z To only update this specific test, also pass `--test-args infinite/infinite-recursion-const-fn.rs`
2019-11-11T15:49:43.7388700Z error: 1 errors occurred comparing output.
2019-11-11T15:49:43.7388761Z status: exit code: 1
2019-11-11T15:49:43.7388761Z status: exit code: 1
2019-11-11T15:49:43.7390575Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/infinite/infinite-recursion-const-fn.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/infinite/infinite-recursion-const-fn" "-Crpath" "-O" "-Cdebuginfo=0" "-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/infinite/infinite-recursion-const-fn/auxiliary" "-A" "unused"
2019-11-11T15:49:43.7390946Z ------------------------------------------
2019-11-11T15:49:43.7390982Z 
2019-11-11T15:49:43.7391214Z ------------------------------------------
2019-11-11T15:49:43.7391282Z stderr:
2019-11-11T15:49:43.7391282Z stderr:
2019-11-11T15:49:43.7391499Z ------------------------------------------
2019-11-11T15:49:43.7391728Z error[E0391]: cycle detected when const-evaluating `a`
2019-11-11T15:49:43.7391996Z   --> /checkout/src/test/ui/infinite/infinite-recursion-const-fn.rs:3:25
2019-11-11T15:49:43.7392046Z    |
2019-11-11T15:49:43.7392295Z LL | const fn a() -> usize { b() } //~ ERROR evaluation of constant value failed
2019-11-11T15:49:43.7392405Z    |
2019-11-11T15:49:43.7392405Z    |
2019-11-11T15:49:43.7392625Z note: ...which requires const-evaluating `b`...
2019-11-11T15:49:43.7392936Z    |
2019-11-11T15:49:43.7392936Z    |
2019-11-11T15:49:43.7393137Z LL | const fn b() -> usize { a() }
2019-11-11T15:49:43.7393201Z    |                         ^^^
2019-11-11T15:49:43.7393838Z    = note: ...which again requires const-evaluating `a`, completing the cycle
2019-11-11T15:49:43.7394343Z note: cycle used when const-evaluating `ARR::{{constant}}#0`
2019-11-11T15:49:43.7394690Z    |
2019-11-11T15:49:43.7394690Z    |
2019-11-11T15:49:43.7394733Z LL | const ARR: [i32; a()] = [5; 6];
2019-11-11T15:49:43.7394824Z 
2019-11-11T15:49:43.7394865Z error: aborting due to previous error
2019-11-11T15:49:43.7394894Z 
2019-11-11T15:49:43.7395137Z For more information about this error, try `rustc --explain E0391`.
---
2019-11-11T15:49:43.7395691Z ---- [ui] ui/invalid_const_promotion.rs stdout ----
2019-11-11T15:49:43.7395723Z 
2019-11-11T15:49:43.7395947Z error: test compilation failed although it shouldn't!
2019-11-11T15:49:43.7395995Z status: exit code: 1
2019-11-11T15:49:43.7396769Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/invalid_const_promotion.rs" "-Zthreads=1" "--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/invalid_const_promotion/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-C" "debug_assertions=yes" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/invalid_const_promotion/auxiliary"
2019-11-11T15:49:43.7397102Z ------------------------------------------
2019-11-11T15:49:43.7397135Z 
2019-11-11T15:49:43.7397349Z ------------------------------------------
2019-11-11T15:49:43.7397409Z stderr:
2019-11-11T15:49:43.7397409Z stderr:
2019-11-11T15:49:43.7397621Z ------------------------------------------
2019-11-11T15:49:43.7397670Z error[E0080]: evaluation of constant value failed
2019-11-11T15:49:43.7397918Z   --> /checkout/src/test/ui/invalid_const_promotion.rs:22:27
2019-11-11T15:49:43.7397977Z    |
2019-11-11T15:49:43.7398205Z LL | const fn bar() -> usize { 0 - 1 }
2019-11-11T15:49:43.7398274Z    |                           ^^^^^ attempt to subtract with overflow
2019-11-11T15:49:43.7398349Z error[E0080]: evaluation of constant expression failed
2019-11-11T15:49:43.7398588Z   --> /checkout/src/test/ui/invalid_const_promotion.rs:25:25
2019-11-11T15:49:43.7398651Z    |
2019-11-11T15:49:43.7398855Z LL |     let _: &'static _ = &bar();
---
2019-11-11T15:49:43.7400079Z ---- [ui] ui/union/union-nodrop.rs stdout ----
2019-11-11T15:49:43.7400111Z 
2019-11-11T15:49:43.7401122Z error: test compilation failed although it shouldn't!
2019-11-11T15:49:43.7401185Z status: exit code: 101
2019-11-11T15:49:43.7401935Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/union/union-nodrop.rs" "-Zthreads=1" "--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/union/union-nodrop/a" "-Crpath" "-O" "-Cdebuginfo=0" "-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/union/union-nodrop/auxiliary"
2019-11-11T15:49:43.7402265Z ------------------------------------------
2019-11-11T15:49:43.7402429Z 
2019-11-11T15:49:43.7402780Z ------------------------------------------
2019-11-11T15:49:43.7402833Z stderr:
2019-11-11T15:49:43.7402833Z stderr:
2019-11-11T15:49:43.7403066Z ------------------------------------------
2019-11-11T15:49:43.7403602Z thread 'rustc' panicked at 'assertion failed: body.arg_count == 0', src/librustc_mir/const_eval.rs:149:5
2019-11-11T15:49:43.7403708Z 
2019-11-11T15:49:43.7403770Z error: internal compiler error: unexpected panic
2019-11-11T15:49:43.7403799Z 
2019-11-11T15:49:43.7403844Z note: the compiler unexpectedly panicked. this is a bug.
2019-11-11T15:49:43.7403844Z note: the compiler unexpectedly panicked. this is a bug.
2019-11-11T15:49:43.7403873Z 
2019-11-11T15:49:43.7404531Z note: we would appreciate a bug report: ***/blob/master/CONTRIBUTING.md#bug-reports
2019-11-11T15:49:43.7404826Z note: rustc 1.40.0-dev running on x86_64-unknown-linux-gnu
2019-11-11T15:49:43.7404873Z 
2019-11-11T15:49:43.7404873Z 
2019-11-11T15:49:43.7405166Z note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-11-11T15:49:43.7405237Z 
2019-11-11T15:49:43.7405463Z ------------------------------------------
2019-11-11T15:49:43.7405495Z 
2019-11-11T15:49:43.7405520Z 
---
2019-11-11T15:49:43.7407190Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-11T15:49:43.7407257Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-11T15:49:43.7407312Z 
2019-11-11T15:49:43.7407337Z 
2019-11-11T15:49:43.7408843Z 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-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-11T15:49:43.7409089Z 
2019-11-11T15:49:43.7409117Z 
2019-11-11T15:49:43.7409162Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-11T15:49:43.7409227Z Build completed unsuccessfully in 1:05:05
2019-11-11T15:49:43.7409227Z Build completed unsuccessfully in 1:05:05
2019-11-11T15:49:43.7449149Z == clock drift check ==
2019-11-11T15:49:43.7468434Z   local time: Mon Nov 11 15:49:43 UTC 2019
2019-11-11T15:49:44.0390355Z   network time: Mon, 11 Nov 2019 15:49:44 GMT
2019-11-11T15:49:44.0392023Z == end clock drift check ==
2019-11-11T15:49:44.7347468Z 
2019-11-11T15:49:44.7468409Z ##[error]Bash exited with code '1'.
2019-11-11T15:49:44.7529159Z ##[section]Starting: Checkout
2019-11-11T15:49:44.7531309Z ==============================================================================
2019-11-11T15:49:44.7531376Z Task         : Get sources
2019-11-11T15:49:44.7531447Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@bors
Copy link
Contributor

bors commented Nov 11, 2019

☀️ Try build successful - checks-azure
Build commit: 29354cb (29354cb42d00615ccadc259b5b9b38f9a362454e)

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit 29354cb, comparison URL.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 11, 2019

We need to think about how this interacts with const heap. If a const fn computes a const heap value, it will now be deduplicated. So if we initialize two statics with such a function, they would refer to the same const heap value.

@tesuji
Copy link
Contributor

tesuji commented Nov 12, 2019

This is insane:
image

@Mark-Simulacrum
Copy link
Member

We may want to alter that benchmark such that it's not mostly testing the no-argument case -- otherwise all of the repeat calls are just cached and it's no longer quite benchmarking what we want it to, probably :)

@davidhewitt
Copy link
Contributor Author

We may want to alter that benchmark such that it's not mostly testing the no-argument case -- otherwise all of the repeat calls are just cached and it's no longer quite benchmarking what we want it to, probably :)

I was actually talking about exactly this to @oli-obk this morning! I'll submit a PR to https://github.com/rust-lang-nursery/rustc-perf shortly ;)


For more information about this error, try `rustc --explain E0080`.
For more information about this error, try `rustc --explain E0391`.
Copy link
Member

Choose a reason for hiding this comment

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

Does removing the use of i32::CONSTANT prevent this hard error? Previously, using #![allow(const_err)] made this supressible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing the use of i32::CONSTANT does indeed prevent the error. It would be nice if the error trace included mention of i32::CONSTANT so that users might figure this out.

I've found a similar case on stable, which I've opened as a separate issue: #66332

Copy link
Contributor

Choose a reason for hiding this comment

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

If the constant were public, the error would persist. So this is a breaking change, where a deny by default lint was changed into an error, but only if using the constant would have errored anyway

Copy link
Contributor

Choose a reason for hiding this comment

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

iirc there's a way to mark a query so that its cycles do something other than report a hard error, but I don't remember the details and whether it would help us here. I'll have a look tomorrow when I'm on a computer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry. This got lost in my todo list.

So We only have cycle_delay_bug, which is not really what we want here, because it will still cause the compilation to fail. We could specifically add a cycle_future_incompat_lint that works exactly like cycle_delay_bug except that it emits a future incompat lint instead.

cc @michaelwoerister I'm not sure if the query system can handle a query succeeding when a cycle occurs.

Copy link
Member

Choose a reason for hiding this comment

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

Any cycle occurring should be fatal for the compilation session. I don't think we ever quite clarified if cycles can leave incr. comp. in an invalid state and sidestep the issue by never committing such possibly invalid state.
(cc @nikomatsakis, correct me if I'm wrong)

Copy link
Contributor

Choose a reason for hiding this comment

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

Recovering from a query cycle is also problematic for a parallel compiler since the location we can recover from is not deterministic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like the conclusion is that we will leave this cycle error as a failure. This is technically a breaking change (move from unusable-but-valid-compile to compile-fail). It's a weird edge case that didn't seem likely to be in use in the wild; indeed no regressions were found in the crater run.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-11-12T12:51:45.5156390Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-12T12:51:45.5339997Z ##[command]git config gc.auto 0
2019-11-12T12:51:45.5408615Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-12T12:51:45.5475721Z ##[command]git config --get-all http.proxy
2019-11-12T12:51:45.5619110Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66294/merge:refs/remotes/pull/66294/merge
---
2019-11-12T13:49:32.0490154Z .................................................................................................... 1400/9232
2019-11-12T13:49:38.1690294Z .................................................................................................... 1500/9232
2019-11-12T13:49:43.8917159Z .................................................................................................... 1600/9232
2019-11-12T13:49:52.5397960Z .................................................................................................... 1700/9232
2019-11-12T13:50:00.5293883Z ..i................................................................................................. 1800/9232
2019-11-12T13:50:06.9325763Z ......................................................................................iiii.i........ 1900/9232
2019-11-12T13:50:27.3757889Z .................................................................................................... 2100/9232
2019-11-12T13:50:29.6398254Z .................................................................................................... 2200/9232
2019-11-12T13:50:32.0716358Z .................................................................................................... 2300/9232
2019-11-12T13:50:41.5726347Z .................................................................................................... 2400/9232
2019-11-12T13:50:41.5726347Z .................................................................................................... 2400/9232
2019-11-12T13:50:58.3850604Z .................................................................................................... 2500/9232
2019-11-12T13:51:02.0556389Z .................................................................................................... 2600/9232
2019-11-12T13:51:12.4774358Z .....................................................i.............................................. 2700/9232
2019-11-12T13:51:19.4830703Z .................................................................................................... 2800/9232
2019-11-12T13:51:26.2101592Z ....................................................i............................................... 2900/9232
2019-11-12T13:51:33.8331026Z .................................................................................................... 3000/9232
2019-11-12T13:51:39.8679337Z .................................................................................................... 3100/9232
2019-11-12T13:51:46.0326480Z ..................................ii.................F...........................................F.. 3200/9232
2019-11-12T13:52:01.2144444Z .................................................................................................... 3400/9232
2019-11-12T13:52:08.8060842Z ..........................i..............................................i.......................... 3500/9232
2019-11-12T13:52:14.3087739Z .................................................................................................... 3600/9232
2019-11-12T13:52:18.8051181Z .................................................................................................... 3700/9232
---
2019-11-12T13:53:28.3129264Z ...................................................................................i...............i 4700/9232
2019-11-12T13:53:34.8299964Z .................................................................................................... 4800/9232
2019-11-12T13:53:43.4499893Z .................................................................................................... 4900/9232
2019-11-12T13:53:48.3489408Z .................................................................................................... 5000/9232
2019-11-12T13:53:59.8331674Z ......................................................................................ii.ii......... 5100/9232
2019-11-12T13:54:02.9317399Z ..i................................................................................................. 5200/9232
2019-11-12T13:54:15.4619078Z .................................................................................................... 5400/9232
2019-11-12T13:54:23.3653305Z ....................................................................i............................... 5500/9232
2019-11-12T13:54:30.3380379Z .................................................................................................... 5600/9232
2019-11-12T13:54:37.6258231Z .................................................................................................... 5700/9232
2019-11-12T13:54:37.6258231Z .................................................................................................... 5700/9232
2019-11-12T13:54:46.3879429Z .....................................................ii...i..ii...........i......................... 5800/9232
2019-11-12T13:55:08.5325407Z .................................................................................................... 6000/9232
2019-11-12T13:55:16.5568357Z .................................................................................................... 6100/9232
2019-11-12T13:55:16.5568357Z .................................................................................................... 6100/9232
2019-11-12T13:55:22.9260675Z ........................................................................i..ii....................... 6200/9232
2019-11-12T13:55:51.4338839Z .................................................................................................... 6400/9232
2019-11-12T13:55:53.4994501Z ........................................i........................................................... 6500/9232
2019-11-12T13:55:55.5526591Z .................................................................................................... 6600/9232
2019-11-12T13:55:57.6933921Z ........................i........................................................................... 6700/9232
---
2019-11-12T14:00:37.9252253Z - error[E0080]: evaluation of constant value failed
2019-11-12T14:00:37.9252610Z + error[E0391]: cycle detected when const-evaluating `a`
2019-11-12T14:00:37.9252945Z 2   --> $DIR/infinite-recursion-const-fn.rs:3:25
2019-11-12T14:00:37.9253115Z 3    |
2019-11-12T14:00:37.9253415Z 4 LL | const fn a() -> usize { b() }
2019-11-12T14:00:37.9253700Z 5    |                         ^^^
2019-11-12T14:00:37.9253991Z -    |                         |
2019-11-12T14:00:37.9254351Z -    |                         reached the configured maximum number of stack frames
2019-11-12T14:00:37.9254351Z -    |                         reached the configured maximum number of stack frames
2019-11-12T14:00:37.9254759Z -    |                         inside call to `b` at $DIR/infinite-recursion-const-fn.rs:3:25
2019-11-12T14:00:37.9254914Z +    |
2019-11-12T14:00:37.9255232Z + note: ...which requires const-evaluating `b`...
2019-11-12T14:00:37.9255937Z +   --> $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T14:00:37.9256568Z +    |
2019-11-12T14:00:37.9257020Z 9 LL | const fn b() -> usize { a() }
2019-11-12T14:00:37.9257802Z -    |                         |
2019-11-12T14:00:37.9258276Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T14:00:37.9258724Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T14:00:37.9259216Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
---
2019-11-12T14:00:37.9279048Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T14:00:37.9279395Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T14:00:37.9279689Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T14:00:37.9279743Z +    |                         ^^^
2019-11-12T14:00:37.9280033Z +    = note: ...which again requires const-evaluating `a`, completing the cycle
2019-11-12T14:00:37.9280287Z + note: cycle used when const-evaluating `ARR::{{constant}}#0`
2019-11-12T14:00:37.9280525Z +   --> $DIR/infinite-recursion-const-fn.rs:5:18
2019-11-12T14:00:37.9280602Z +    |
2019-11-12T14:00:37.9280646Z 61 LL | const ARR: [i32; a()] = [5; 6];
2019-11-12T14:00:37.9281090Z -    |                  --- inside call to `a` at $DIR/infinite-recursion-const-fn.rs:5:18
2019-11-12T14:00:37.9281201Z 63 
2019-11-12T14:00:37.9281406Z 64 error: aborting due to previous error
2019-11-12T14:00:37.9281463Z 65 
2019-11-12T14:00:37.9281654Z 
2019-11-12T14:00:37.9281654Z 
2019-11-12T14:00:37.9282196Z - For more information about this error, try `rustc --explain E0080`.
2019-11-12T14:00:37.9282413Z + For more information about this error, try `rustc --explain E0391`.
2019-11-12T14:00:37.9282471Z 67 
2019-11-12T14:00:37.9282493Z 
2019-11-12T14:00:37.9282513Z 
2019-11-12T14:00:37.9282549Z The actual stderr differed from the expected stderr.
2019-11-12T14:00:37.9282845Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/infinite/infinite-recursion-const-fn/infinite-recursion-const-fn.stderr
2019-11-12T14:00:37.9283059Z To update references, rerun the tests and pass the `--bless` flag
2019-11-12T14:00:37.9283470Z To only update this specific test, also pass `--test-args infinite/infinite-recursion-const-fn.rs`
2019-11-12T14:00:37.9283553Z error: 1 errors occurred comparing output.
2019-11-12T14:00:37.9283587Z status: exit code: 1
2019-11-12T14:00:37.9283587Z status: exit code: 1
2019-11-12T14:00:37.9284346Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/infinite/infinite-recursion-const-fn.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/infinite/infinite-recursion-const-fn" "-Crpath" "-O" "-Cdebuginfo=0" "-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/infinite/infinite-recursion-const-fn/auxiliary" "-A" "unused"
2019-11-12T14:00:37.9284666Z ------------------------------------------
2019-11-12T14:00:37.9284694Z 
2019-11-12T14:00:37.9284871Z ------------------------------------------
2019-11-12T14:00:37.9284926Z stderr:
2019-11-12T14:00:37.9284926Z stderr:
2019-11-12T14:00:37.9285101Z ------------------------------------------
2019-11-12T14:00:37.9285289Z error[E0391]: cycle detected when const-evaluating `a`
2019-11-12T14:00:37.9285496Z   --> /checkout/src/test/ui/infinite/infinite-recursion-const-fn.rs:3:25
2019-11-12T14:00:37.9285554Z    |
2019-11-12T14:00:37.9286206Z LL | const fn a() -> usize { b() } //~ ERROR evaluation of constant value failed
2019-11-12T14:00:37.9286333Z    |
2019-11-12T14:00:37.9286333Z    |
2019-11-12T14:00:37.9286573Z note: ...which requires const-evaluating `b`...
2019-11-12T14:00:37.9286909Z    |
2019-11-12T14:00:37.9286909Z    |
2019-11-12T14:00:37.9287127Z LL | const fn b() -> usize { a() }
2019-11-12T14:00:37.9287177Z    |                         ^^^
2019-11-12T14:00:37.9287603Z    = note: ...which again requires const-evaluating `a`, completing the cycle
2019-11-12T14:00:37.9287860Z note: cycle used when const-evaluating `ARR::{{constant}}#0`
2019-11-12T14:00:37.9288191Z    |
2019-11-12T14:00:37.9288191Z    |
2019-11-12T14:00:37.9288235Z LL | const ARR: [i32; a()] = [5; 6];
2019-11-12T14:00:37.9288311Z 
2019-11-12T14:00:37.9288381Z error: aborting due to previous error
2019-11-12T14:00:37.9288410Z 
2019-11-12T14:00:37.9288669Z For more information about this error, try `rustc --explain E0391`.
---
2019-11-12T14:00:37.9289462Z ---- [ui] ui/invalid_const_promotion.rs stdout ----
2019-11-12T14:00:37.9289489Z 
2019-11-12T14:00:37.9289694Z error: test compilation failed although it shouldn't!
2019-11-12T14:00:37.9289742Z status: exit code: 1
2019-11-12T14:00:37.9290538Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/invalid_const_promotion.rs" "-Zthreads=1" "--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/invalid_const_promotion/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-C" "debug_assertions=yes" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/invalid_const_promotion/auxiliary"
2019-11-12T14:00:37.9290810Z ------------------------------------------
2019-11-12T14:00:37.9290837Z 
2019-11-12T14:00:37.9291013Z ------------------------------------------
2019-11-12T14:00:37.9291049Z stderr:
2019-11-12T14:00:37.9291049Z stderr:
2019-11-12T14:00:37.9291244Z ------------------------------------------
2019-11-12T14:00:37.9291284Z error[E0080]: evaluation of constant value failed
2019-11-12T14:00:37.9291483Z   --> /checkout/src/test/ui/invalid_const_promotion.rs:22:27
2019-11-12T14:00:37.9291540Z    |
2019-11-12T14:00:37.9291716Z LL | const fn bar() -> usize { 0 - 1 }
2019-11-12T14:00:37.9291759Z    |                           ^^^^^ attempt to subtract with overflow
2019-11-12T14:00:37.9291836Z error[E0080]: evaluation of constant expression failed
2019-11-12T14:00:37.9292469Z   --> /checkout/src/test/ui/invalid_const_promotion.rs:25:25
2019-11-12T14:00:37.9292515Z    |
2019-11-12T14:00:37.9292730Z LL |     let _: &'static _ = &bar();
---
2019-11-12T14:00:37.9294150Z ---- [ui] ui/union/union-nodrop.rs stdout ----
2019-11-12T14:00:37.9294178Z 
2019-11-12T14:00:37.9294552Z error: test compilation failed although it shouldn't!
2019-11-12T14:00:37.9294612Z status: exit code: 101
2019-11-12T14:00:37.9295243Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/union/union-nodrop.rs" "-Zthreads=1" "--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/union/union-nodrop/a" "-Crpath" "-O" "-Cdebuginfo=0" "-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/union/union-nodrop/auxiliary"
2019-11-12T14:00:37.9295626Z ------------------------------------------
2019-11-12T14:00:37.9295655Z 
2019-11-12T14:00:37.9296421Z ------------------------------------------
2019-11-12T14:00:37.9296494Z stderr:
2019-11-12T14:00:37.9296494Z stderr:
2019-11-12T14:00:37.9296725Z ------------------------------------------
2019-11-12T14:00:37.9297029Z thread 'rustc' panicked at 'assertion failed: body.arg_count == 0', src/librustc_mir/const_eval.rs:149:5
2019-11-12T14:00:37.9297162Z 
2019-11-12T14:00:37.9297208Z error: internal compiler error: unexpected panic
2019-11-12T14:00:37.9297237Z 
2019-11-12T14:00:37.9297301Z note: the compiler unexpectedly panicked. this is a bug.
2019-11-12T14:00:37.9297301Z note: the compiler unexpectedly panicked. this is a bug.
2019-11-12T14:00:37.9297333Z 
2019-11-12T14:00:37.9297764Z note: we would appreciate a bug report: ***/blob/master/CONTRIBUTING.md#bug-reports
2019-11-12T14:00:37.9298086Z note: rustc 1.40.0-dev running on x86_64-unknown-linux-gnu
2019-11-12T14:00:37.9298130Z 
2019-11-12T14:00:37.9298130Z 
2019-11-12T14:00:37.9298448Z note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-11-12T14:00:37.9298512Z 
2019-11-12T14:00:37.9298737Z ------------------------------------------
2019-11-12T14:00:37.9298770Z 
2019-11-12T14:00:37.9298816Z 
---
2019-11-12T14:00:37.9313490Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-12T14:00:37.9313568Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-12T14:00:37.9313650Z 
2019-11-12T14:00:37.9313673Z 
2019-11-12T14:00:37.9315402Z 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-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-12T14:00:37.9316156Z 
2019-11-12T14:00:37.9316196Z 
2019-11-12T14:00:37.9316246Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-12T14:00:37.9316316Z Build completed unsuccessfully in 1:02:26
2019-11-12T14:00:37.9316316Z Build completed unsuccessfully in 1:02:26
2019-11-12T14:00:37.9368836Z == clock drift check ==
2019-11-12T14:00:37.9385543Z   local time: Tue Nov 12 14:00:37 UTC 2019
2019-11-12T14:00:38.2232430Z   network time: Tue, 12 Nov 2019 14:00:38 GMT
2019-11-12T14:00:38.2232817Z == end clock drift check ==
2019-11-12T14:00:38.9616564Z 
2019-11-12T14:00:38.9723048Z ##[error]Bash exited with code '1'.
2019-11-12T14:00:38.9765439Z ##[section]Starting: Checkout
2019-11-12T14:00:38.9768074Z ==============================================================================
2019-11-12T14:00:38.9768134Z Task         : Get sources
2019-11-12T14:00:38.9768201Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-11-12T14:21:54.7494220Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-12T14:21:54.7674183Z ##[command]git config gc.auto 0
2019-11-12T14:21:54.7758354Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-12T14:21:54.7817046Z ##[command]git config --get-all http.proxy
2019-11-12T14:21:54.7970427Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66294/merge:refs/remotes/pull/66294/merge
---
2019-11-12T15:22:11.1407710Z .................................................................................................... 1400/9232
2019-11-12T15:22:17.5004158Z .................................................................................................... 1500/9232
2019-11-12T15:22:24.2664200Z .................................................................................................... 1600/9232
2019-11-12T15:22:32.6637506Z .................................................................................................... 1700/9232
2019-11-12T15:22:41.1305725Z ..i................................................................................................. 1800/9232
2019-11-12T15:22:47.9905571Z ......................................................................................iiiii......... 1900/9232
2019-11-12T15:23:09.5679758Z .................................................................................................... 2100/9232
2019-11-12T15:23:11.9279036Z .................................................................................................... 2200/9232
2019-11-12T15:23:14.4723196Z .................................................................................................... 2300/9232
2019-11-12T15:23:24.0582305Z .................................................................................................... 2400/9232
2019-11-12T15:23:24.0582305Z .................................................................................................... 2400/9232
2019-11-12T15:23:41.1315533Z .................................................................................................... 2500/9232
2019-11-12T15:23:44.9468263Z .................................................................................................... 2600/9232
2019-11-12T15:23:55.5682219Z .....................................................i.............................................. 2700/9232
2019-11-12T15:24:02.9591097Z .................................................................................................... 2800/9232
2019-11-12T15:24:09.8174495Z ....................................................i............................................... 2900/9232
2019-11-12T15:24:17.6950751Z .................................................................................................... 3000/9232
2019-11-12T15:24:23.8170440Z .................................................................................................... 3100/9232
2019-11-12T15:24:30.4833676Z ..................................ii.................F...........................................F.. 3200/9232
2019-11-12T15:24:46.6853335Z .................................................................................................... 3400/9232
2019-11-12T15:24:54.2168285Z ..........................i..............................................i.......................... 3500/9232
2019-11-12T15:24:59.4033439Z .................................................................................................... 3600/9232
2019-11-12T15:25:05.1364883Z .................................................................................................... 3700/9232
---
2019-11-12T15:26:17.1314108Z ...................................................................................i...............i 4700/9232
2019-11-12T15:26:24.0858583Z .................................................................................................... 4800/9232
2019-11-12T15:26:33.2784345Z .................................................................................................... 4900/9232
2019-11-12T15:26:38.5147215Z .................................................................................................... 5000/9232
2019-11-12T15:26:49.9206924Z ......................................................................................ii.ii......... 5100/9232
2019-11-12T15:26:53.7423507Z ..i................................................................................................. 5200/9232
2019-11-12T15:27:07.0301940Z .................................................................................................... 5400/9232
2019-11-12T15:27:15.4144535Z ....................................................................i............................... 5500/9232
2019-11-12T15:27:22.9486254Z .................................................................................................... 5600/9232
2019-11-12T15:27:30.5737611Z .................................................................................................... 5700/9232
2019-11-12T15:27:30.5737611Z .................................................................................................... 5700/9232
2019-11-12T15:27:39.8072062Z .....................................................ii...i..ii...........i......................... 5800/9232
2019-11-12T15:28:02.7024967Z .................................................................................................... 6000/9232
2019-11-12T15:28:10.9598809Z .................................................................................................... 6100/9232
2019-11-12T15:28:10.9598809Z .................................................................................................... 6100/9232
2019-11-12T15:28:15.9748759Z ........................................................................i..ii....................... 6200/9232
2019-11-12T15:28:45.1470110Z .................................................................................................... 6400/9232
2019-11-12T15:28:47.3579780Z ........................................i........................................................... 6500/9232
2019-11-12T15:28:49.5856777Z .................................................................................................... 6600/9232
2019-11-12T15:28:51.9863665Z ........................i........................................................................... 6700/9232
---
2019-11-12T15:33:41.5986181Z - error[E0080]: evaluation of constant value failed
2019-11-12T15:33:41.5986723Z + error[E0391]: cycle detected when const-evaluating `a`
2019-11-12T15:33:41.5987236Z 2   --> $DIR/infinite-recursion-const-fn.rs:3:25
2019-11-12T15:33:41.5987541Z 3    |
2019-11-12T15:33:41.5987991Z 4 LL | const fn a() -> usize { b() }
2019-11-12T15:33:41.5988487Z 5    |                         ^^^
2019-11-12T15:33:41.5988927Z -    |                         |
2019-11-12T15:33:41.5989710Z -    |                         reached the configured maximum number of stack frames
2019-11-12T15:33:41.5989710Z -    |                         reached the configured maximum number of stack frames
2019-11-12T15:33:41.5990320Z -    |                         inside call to `b` at $DIR/infinite-recursion-const-fn.rs:3:25
2019-11-12T15:33:41.5990607Z +    |
2019-11-12T15:33:41.5991072Z + note: ...which requires const-evaluating `b`...
2019-11-12T15:33:41.5991602Z +   --> $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T15:33:41.5991895Z +    |
2019-11-12T15:33:41.5992361Z 9 LL | const fn b() -> usize { a() }
2019-11-12T15:33:41.5993606Z -    |                         |
2019-11-12T15:33:41.5994301Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T15:33:41.5994871Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T15:33:41.5995438Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
---
2019-11-12T15:33:41.6021143Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T15:33:41.6021623Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T15:33:41.6022070Z -    |                         inside call to `a` at $DIR/infinite-recursion-const-fn.rs:4:25
2019-11-12T15:33:41.6022273Z +    |                         ^^^
2019-11-12T15:33:41.6022659Z +    = note: ...which again requires const-evaluating `a`, completing the cycle
2019-11-12T15:33:41.6023060Z + note: cycle used when const-evaluating `ARR::{{constant}}#0`
2019-11-12T15:33:41.6024058Z +   --> $DIR/infinite-recursion-const-fn.rs:5:18
2019-11-12T15:33:41.6024303Z +    |
2019-11-12T15:33:41.6024441Z 61 LL | const ARR: [i32; a()] = [5; 6];
2019-11-12T15:33:41.6024888Z -    |                  --- inside call to `a` at $DIR/infinite-recursion-const-fn.rs:5:18
2019-11-12T15:33:41.6025197Z 63 
2019-11-12T15:33:41.6025348Z 64 error: aborting due to previous error
2019-11-12T15:33:41.6025476Z 65 
2019-11-12T15:33:41.6025590Z 
2019-11-12T15:33:41.6025590Z 
2019-11-12T15:33:41.6025979Z - For more information about this error, try `rustc --explain E0080`.
2019-11-12T15:33:41.6026526Z + For more information about this error, try `rustc --explain E0391`.
2019-11-12T15:33:41.6026751Z 67 
2019-11-12T15:33:41.6026868Z 
2019-11-12T15:33:41.6027003Z 
2019-11-12T15:33:41.6027156Z The actual stderr differed from the expected stderr.
2019-11-12T15:33:41.6027655Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/infinite/infinite-recursion-const-fn/infinite-recursion-const-fn.stderr
2019-11-12T15:33:41.6028095Z To update references, rerun the tests and pass the `--bless` flag
2019-11-12T15:33:41.6028555Z To only update this specific test, also pass `--test-args infinite/infinite-recursion-const-fn.rs`
2019-11-12T15:33:41.6029006Z error: 1 errors occurred comparing output.
2019-11-12T15:33:41.6029164Z status: exit code: 1
2019-11-12T15:33:41.6029164Z status: exit code: 1
2019-11-12T15:33:41.6030131Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/infinite/infinite-recursion-const-fn.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/infinite/infinite-recursion-const-fn" "-Crpath" "-O" "-Cdebuginfo=0" "-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/infinite/infinite-recursion-const-fn/auxiliary" "-A" "unused"
2019-11-12T15:33:41.6030741Z ------------------------------------------
2019-11-12T15:33:41.6030915Z 
2019-11-12T15:33:41.6031276Z ------------------------------------------
2019-11-12T15:33:41.6031454Z stderr:
2019-11-12T15:33:41.6031454Z stderr:
2019-11-12T15:33:41.6031796Z ------------------------------------------
2019-11-12T15:33:41.6032197Z error[E0391]: cycle detected when const-evaluating `a`
2019-11-12T15:33:41.6032663Z   --> /checkout/src/test/ui/infinite/infinite-recursion-const-fn.rs:3:25
2019-11-12T15:33:41.6032841Z    |
2019-11-12T15:33:41.6033573Z LL | const fn a() -> usize { b() } //~ ERROR evaluation of constant value failed
2019-11-12T15:33:41.6037927Z    |
2019-11-12T15:33:41.6037927Z    |
2019-11-12T15:33:41.6038306Z note: ...which requires const-evaluating `b`...
2019-11-12T15:33:41.6038613Z    |
2019-11-12T15:33:41.6038613Z    |
2019-11-12T15:33:41.6038815Z LL | const fn b() -> usize { a() }
2019-11-12T15:33:41.6038880Z    |                         ^^^
2019-11-12T15:33:41.6039128Z    = note: ...which again requires const-evaluating `a`, completing the cycle
2019-11-12T15:33:41.6039384Z note: cycle used when const-evaluating `ARR::{{constant}}#0`
2019-11-12T15:33:41.6039695Z    |
2019-11-12T15:33:41.6039695Z    |
2019-11-12T15:33:41.6039737Z LL | const ARR: [i32; a()] = [5; 6];
2019-11-12T15:33:41.6039825Z 
2019-11-12T15:33:41.6039867Z error: aborting due to previous error
2019-11-12T15:33:41.6039904Z 
2019-11-12T15:33:41.6040166Z For more information about this error, try `rustc --explain E0391`.
---
2019-11-12T15:33:41.6040701Z ---- [ui] ui/invalid_const_promotion.rs stdout ----
2019-11-12T15:33:41.6040733Z 
2019-11-12T15:33:41.6040952Z error: test compilation failed although it shouldn't!
2019-11-12T15:33:41.6041015Z status: exit code: 1
2019-11-12T15:33:41.6041886Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/invalid_const_promotion.rs" "-Zthreads=1" "--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/invalid_const_promotion/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-C" "debug_assertions=yes" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/invalid_const_promotion/auxiliary"
2019-11-12T15:33:41.6042272Z ------------------------------------------
2019-11-12T15:33:41.6042306Z 
2019-11-12T15:33:41.6042537Z ------------------------------------------
2019-11-12T15:33:41.6042582Z stderr:
2019-11-12T15:33:41.6042582Z stderr:
2019-11-12T15:33:41.6042791Z ------------------------------------------
2019-11-12T15:33:41.6042839Z error[E0080]: evaluation of constant value failed
2019-11-12T15:33:41.6043088Z   --> /checkout/src/test/ui/invalid_const_promotion.rs:22:27
2019-11-12T15:33:41.6043228Z    |
2019-11-12T15:33:41.6048371Z LL | const fn bar() -> usize { 0 - 1 }
2019-11-12T15:33:41.6048462Z    |                           ^^^^^ attempt to subtract with overflow
2019-11-12T15:33:41.6048538Z error[E0080]: evaluation of constant expression failed
2019-11-12T15:33:41.6048799Z   --> /checkout/src/test/ui/invalid_const_promotion.rs:25:25
2019-11-12T15:33:41.6048846Z    |
2019-11-12T15:33:41.6049061Z LL |     let _: &'static _ = &bar();
---
2019-11-12T15:33:41.6056621Z ---- [ui] ui/union/union-nodrop.rs stdout ----
2019-11-12T15:33:41.6056652Z 
2019-11-12T15:33:41.6056888Z error: test compilation failed although it shouldn't!
2019-11-12T15:33:41.6056937Z status: exit code: 101
2019-11-12T15:33:41.6057650Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/union/union-nodrop.rs" "-Zthreads=1" "--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/union/union-nodrop/a" "-Crpath" "-O" "-Cdebuginfo=0" "-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/union/union-nodrop/auxiliary"
2019-11-12T15:33:41.6057974Z ------------------------------------------
2019-11-12T15:33:41.6058031Z 
2019-11-12T15:33:41.6058249Z ------------------------------------------
2019-11-12T15:33:41.6058293Z stderr:
2019-11-12T15:33:41.6058293Z stderr:
2019-11-12T15:33:41.6058500Z ------------------------------------------
2019-11-12T15:33:41.6058795Z thread 'rustc' panicked at 'assertion failed: body.arg_count == 0', src/librustc_mir/const_eval.rs:149:5
2019-11-12T15:33:41.6058899Z 
2019-11-12T15:33:41.6058957Z error: internal compiler error: unexpected panic
2019-11-12T15:33:41.6058986Z 
2019-11-12T15:33:41.6059029Z note: the compiler unexpectedly panicked. this is a bug.
2019-11-12T15:33:41.6059029Z note: the compiler unexpectedly panicked. this is a bug.
2019-11-12T15:33:41.6059059Z 
2019-11-12T15:33:41.6059485Z note: we would appreciate a bug report: ***/blob/master/CONTRIBUTING.md#bug-reports
2019-11-12T15:33:41.6059771Z note: rustc 1.40.0-dev running on x86_64-unknown-linux-gnu
2019-11-12T15:33:41.6059819Z 
2019-11-12T15:33:41.6059819Z 
2019-11-12T15:33:41.6060097Z note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-11-12T15:33:41.6060169Z 
2019-11-12T15:33:41.6060397Z ------------------------------------------
2019-11-12T15:33:41.6060428Z 
2019-11-12T15:33:41.6060453Z 
---
2019-11-12T15:33:41.6061810Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-12T15:33:41.6061883Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-12T15:33:41.6061915Z 
2019-11-12T15:33:41.6062029Z 
2019-11-12T15:33:41.6063861Z 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-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-12T15:33:41.6064101Z 
2019-11-12T15:33:41.6064130Z 
2019-11-12T15:33:41.6064234Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-12T15:33:41.6064284Z Build completed unsuccessfully in 1:05:06
2019-11-12T15:33:41.6064284Z Build completed unsuccessfully in 1:05:06
2019-11-12T15:33:41.6109126Z == clock drift check ==
2019-11-12T15:33:41.6127282Z   local time: Tue Nov 12 15:33:41 UTC 2019
2019-11-12T15:33:41.6971253Z   network time: Tue, 12 Nov 2019 15:33:41 GMT
2019-11-12T15:33:41.6981583Z == end clock drift check ==
2019-11-12T15:33:42.5056166Z 
2019-11-12T15:33:42.5184393Z ##[error]Bash exited with code '1'.
2019-11-12T15:33:42.5227110Z ##[section]Starting: Checkout
2019-11-12T15:33:42.5228717Z ==============================================================================
2019-11-12T15:33:42.5228765Z Task         : Get sources
2019-11-12T15:33:42.5228805Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-11-12T16:23:09.6915051Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-12T16:23:09.7116423Z ##[command]git config gc.auto 0
2019-11-12T16:23:09.7170124Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-12T16:23:10.4012712Z ##[command]git config --get-all http.proxy
2019-11-12T16:23:10.4020647Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66294/merge:refs/remotes/pull/66294/merge
---
2019-11-12T17:19:28.8785037Z .................................................................................................... 1400/9232
2019-11-12T17:19:35.1738105Z .................................................................................................... 1500/9232
2019-11-12T17:19:41.2263849Z .................................................................................................... 1600/9232
2019-11-12T17:19:49.9922944Z .................................................................................................... 1700/9232
2019-11-12T17:19:58.2935848Z ..i................................................................................................. 1800/9232
2019-11-12T17:20:04.9423797Z .......................................................................................iiiii........ 1900/9232
2019-11-12T17:20:25.4203369Z .................................................................................................... 2100/9232
2019-11-12T17:20:27.7052233Z .................................................................................................... 2200/9232
2019-11-12T17:20:30.0840225Z .................................................................................................... 2300/9232
2019-11-12T17:20:39.3698667Z .................................................................................................... 2400/9232
2019-11-12T17:20:39.3698667Z .................................................................................................... 2400/9232
2019-11-12T17:20:55.5347071Z .................................................................................................... 2500/9232
2019-11-12T17:20:59.2378967Z .................................................................................................... 2600/9232
2019-11-12T17:21:09.9287087Z .....................................................i.............................................. 2700/9232
2019-11-12T17:21:17.2087069Z .................................................................................................... 2800/9232
2019-11-12T17:21:23.7100779Z ....................................................i............................................... 2900/9232
2019-11-12T17:21:31.4717389Z .................................................................................................... 3000/9232
2019-11-12T17:21:37.4769653Z .................................................................................................... 3100/9232
2019-11-12T17:21:43.9201957Z ..................................ii.............................................................F.. 3200/9232
2019-11-12T17:21:59.5859627Z .................................................................................................... 3400/9232
2019-11-12T17:22:06.8812167Z ..........................i..............................................i.......................... 3500/9232
2019-11-12T17:22:11.9870827Z .................................................................................................... 3600/9232
2019-11-12T17:22:17.3782196Z .................................................................................................... 3700/9232
---
2019-11-12T17:23:27.0252370Z ...................................................................................i...............i 4700/9232
2019-11-12T17:23:33.9142170Z .................................................................................................... 4800/9232
2019-11-12T17:23:43.0061750Z .................................................................................................... 4900/9232
2019-11-12T17:23:48.0863808Z .................................................................................................... 5000/9232
2019-11-12T17:23:59.1361821Z ......................................................................................ii.ii......... 5100/9232
2019-11-12T17:24:02.7578829Z ..i................................................................................................. 5200/9232
2019-11-12T17:24:15.6776026Z .................................................................................................... 5400/9232
2019-11-12T17:24:23.4958642Z ....................................................................i............................... 5500/9232
2019-11-12T17:24:30.5808655Z .................................................................................................... 5600/9232
2019-11-12T17:24:37.9931806Z .................................................................................................... 5700/9232
2019-11-12T17:24:37.9931806Z .................................................................................................... 5700/9232
2019-11-12T17:24:46.8211886Z .....................................................ii...i..ii...........i......................... 5800/9232
2019-11-12T17:25:08.7621657Z .................................................................................................... 6000/9232
2019-11-12T17:25:16.8395146Z .................................................................................................... 6100/9232
2019-11-12T17:25:16.8395146Z .................................................................................................... 6100/9232
2019-11-12T17:25:24.3805022Z ........................................................................i..ii....................... 6200/9232
2019-11-12T17:25:52.2348221Z .................................................................................................... 6400/9232
2019-11-12T17:25:54.7040275Z ........................................i........................................................... 6500/9232
2019-11-12T17:25:56.5519317Z .................................................................................................... 6600/9232
2019-11-12T17:25:58.9025187Z ........................i........................................................................... 6700/9232
---
2019-11-12T17:30:43.3326809Z ---- [ui] ui/invalid_const_promotion.rs stdout ----
2019-11-12T17:30:43.3326854Z 
2019-11-12T17:30:43.3327728Z error: test compilation failed although it shouldn't!
2019-11-12T17:30:43.3327777Z status: exit code: 1
2019-11-12T17:30:43.3328723Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/invalid_const_promotion.rs" "-Zthreads=1" "--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/invalid_const_promotion/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-C" "debug_assertions=yes" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/invalid_const_promotion/auxiliary"
2019-11-12T17:30:43.3329243Z ------------------------------------------
2019-11-12T17:30:43.3329273Z 
2019-11-12T17:30:43.3329486Z ------------------------------------------
2019-11-12T17:30:43.3329526Z stderr:
2019-11-12T17:30:43.3329526Z stderr:
2019-11-12T17:30:43.3329744Z ------------------------------------------
2019-11-12T17:30:43.3329789Z error[E0080]: evaluation of constant value failed
2019-11-12T17:30:43.3330009Z   --> /checkout/src/test/ui/invalid_const_promotion.rs:22:27
2019-11-12T17:30:43.3330072Z    |
2019-11-12T17:30:43.3330454Z LL | const fn bar() -> usize { 0 - 1 }
2019-11-12T17:30:43.3330527Z    |                           ^^^^^ attempt to subtract with overflow
2019-11-12T17:30:43.3330615Z error[E0080]: evaluation of constant expression failed
2019-11-12T17:30:43.3330880Z   --> /checkout/src/test/ui/invalid_const_promotion.rs:25:25
2019-11-12T17:30:43.3330922Z    |
2019-11-12T17:30:43.3330922Z    |
2019-11-12T17:30:43.3331164Z LL |     let _: &'static _ = &bar();  // FIXME: No longer compiles
2019-11-12T17:30:43.3331401Z    |                          |
2019-11-12T17:30:43.3331462Z    |                          referenced constant has errors
2019-11-12T17:30:43.3331489Z 
2019-11-12T17:30:43.3331527Z error: aborting due to 2 previous errors
---
2019-11-12T17:30:43.3332439Z ---- [ui] ui/union/union-nodrop.rs stdout ----
2019-11-12T17:30:43.3332467Z 
2019-11-12T17:30:43.3332672Z error: test compilation failed although it shouldn't!
2019-11-12T17:30:43.3332733Z status: exit code: 101
2019-11-12T17:30:43.3333376Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/union/union-nodrop.rs" "-Zthreads=1" "--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/union/union-nodrop/a" "-Crpath" "-O" "-Cdebuginfo=0" "-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/union/union-nodrop/auxiliary"
2019-11-12T17:30:43.3333674Z ------------------------------------------
2019-11-12T17:30:43.3333703Z 
2019-11-12T17:30:43.3333907Z ------------------------------------------
2019-11-12T17:30:43.3333975Z stderr:
2019-11-12T17:30:43.3333975Z stderr:
2019-11-12T17:30:43.3334175Z ------------------------------------------
2019-11-12T17:30:43.3334432Z thread 'rustc' panicked at 'assertion failed: body.arg_count == 0', src/librustc_mir/const_eval.rs:151:5
2019-11-12T17:30:43.3334537Z 
2019-11-12T17:30:43.3334576Z error: internal compiler error: unexpected panic
2019-11-12T17:30:43.3334601Z 
2019-11-12T17:30:43.3334658Z note: the compiler unexpectedly panicked. this is a bug.
2019-11-12T17:30:43.3334658Z note: the compiler unexpectedly panicked. this is a bug.
2019-11-12T17:30:43.3334684Z 
2019-11-12T17:30:43.3335077Z note: we would appreciate a bug report: ***/blob/master/CONTRIBUTING.md#bug-reports
2019-11-12T17:30:43.3335377Z note: rustc 1.40.0-dev running on x86_64-unknown-linux-gnu
2019-11-12T17:30:43.3335407Z 
2019-11-12T17:30:43.3335407Z 
2019-11-12T17:30:43.3335878Z note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-11-12T17:30:43.3335944Z 
2019-11-12T17:30:43.3336153Z ------------------------------------------
2019-11-12T17:30:43.3336182Z 
2019-11-12T17:30:43.3336224Z 
---
2019-11-12T17:30:43.3368945Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-12T17:30:43.3369242Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-12T17:30:43.3392107Z 
2019-11-12T17:30:43.3392189Z 
2019-11-12T17:30:43.3394163Z 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-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-12T17:30:43.3394518Z 
2019-11-12T17:30:43.3394549Z 
2019-11-12T17:30:43.3401272Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-12T17:30:43.3401369Z Build completed unsuccessfully in 1:01:12
2019-11-12T17:30:43.3401369Z Build completed unsuccessfully in 1:01:12
2019-11-12T17:30:43.3452734Z == clock drift check ==
2019-11-12T17:30:43.3465426Z   local time: Tue Nov 12 17:30:43 UTC 2019
2019-11-12T17:30:43.4180787Z   network time: Tue, 12 Nov 2019 17:30:43 GMT
2019-11-12T17:30:43.4187427Z == end clock drift check ==
2019-11-12T17:30:44.1264871Z 
2019-11-12T17:30:44.1382278Z ##[error]Bash exited with code '1'.
2019-11-12T17:30:44.1415222Z ##[section]Starting: Checkout
2019-11-12T17:30:44.1416785Z ==============================================================================
2019-11-12T17:30:44.1416845Z Task         : Get sources
2019-11-12T17:30:44.1416902Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@bors
Copy link
Contributor

bors commented Nov 13, 2019

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

@davidhewitt
Copy link
Contributor Author

Have rebased and squashed. On a laptop without mains power at the moment so I haven't run the test suite lest I kill the machine building llvm 😆

WRT this comment:

We need to think about how this interacts with const heap. If a const fn computes a const heap value, it will now be deduplicated. So if we initialize two statics with such a function, they would refer to the same const heap value.

I chatted with @oli-obk in-person a little more about this. As I understand it, at the moment we haven't implemented any const heap, so there is currently no clash with this optimisation.

When const heap does land, we'll need to ensure that there's no soundness issues caused by this optimisation. If there is, it's unfortunate but not a big issue if we remove this optimisation from the compiler.

I'll also add a note with more design detail on rust-lang/const-eval#20

@JohnCSimon
Copy link
Member

Ping from triage:
@oli-obk Can you please review this PR?
Thanks.

@bors
Copy link
Contributor

bors commented Nov 19, 2019

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

@oli-obk
Copy link
Contributor

oli-obk commented Nov 22, 2019

@davidhewitt I suggest we run crater on this PR to see if anyone is allowing the deny-by-default const-err lint in this situation. If not, I propose to merge it even if it is a breaking change. The only thing that breaks is code that is unusable and already has a deny-by-default lint

If you are ok with this, please rebase. I'll trigger the crater run then

@bjorn3
Copy link
Member

bjorn3 commented Nov 26, 2019

2410 errors

@davidhewitt
Copy link
Contributor Author

2410 errors

I'm not familiar with crater reports, but it looks like those errors already existed rather than being introduced by this PR?

@bjorn3
Copy link
Member

bjorn3 commented Nov 27, 2019

Indeed.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 27, 2019

Oh no, master changed again. Please rebase again

When a const function is being evaluated, as long as all its
arguments are zero-sized-types (or it has no arguments) then we
can trivially memoize the evaluation result using the existing
query mechanism.
@davidhewitt
Copy link
Contributor Author

Rebased once again 😄

@oli-obk
Copy link
Contributor

oli-obk commented Nov 27, 2019

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Nov 27, 2019

📌 Commit 5398139 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 Nov 27, 2019
@bors
Copy link
Contributor

bors commented Nov 27, 2019

⌛ Testing commit 5398139 with merge 5a4558db0a7a962965661a0f260580776df72e64...

src/librustc_mir/const_eval.rs Outdated Show resolved Hide resolved
Co-Authored-By: lqd <remy.rakic+github@gmail.com>
@davidhewitt
Copy link
Contributor Author

I've just added a commit for a typo spotted by @lqd (many thanks). Does bors need approval again to perform the merge?

@lqd
Copy link
Member

lqd commented Nov 27, 2019

yes bors will need the new commit approved

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Nov 27, 2019

📌 Commit a28fbd4 has been approved by oli-obk

@lqd
Copy link
Member

lqd commented Nov 27, 2019

and since the PR has perf implications:

@bors rollup=never

//
// For the moment we only do this for functions which take no arguments
// (or all arguments are ZSTs) so that we don't memoize too much.
if self.tcx.is_const_fn_raw(instance.def.def_id()) &&
Copy link
Member

Choose a reason for hiding this comment

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

This means we do that even in the Miri interpreter, when such functions are run at "run-time", right? I think that's wrong: the function, even without any arguments, can access global state and cause aliasing violations on each call. So I think this PR as-is will regress Miri's ability to find UB.

Copy link
Member

Choose a reason for hiding this comment

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

I propose to instead move memoization into const_eval's find_fn implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a situation where a const fn can access global state which itself is not constant? This seems like the only situation to me where aliasing may be an issue? (But I think you know much more about Miri than me! 😄)

Copy link
Contributor Author

@davidhewitt davidhewitt Nov 27, 2019

Choose a reason for hiding this comment

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

I propose to instead move memoization into const_eval's find_fn implementation.

How would you like such an implementation to work? Memoize the evaluation of the body and then return that from find_fn? Or memoize something else entirely?

Copy link
Member

Choose a reason for hiding this comment

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

Well we might have to expand what find_fn can return, and the name might have to change reflecting that.

Is there a situation where a const fn can access global state which itself is not constant?

Right now, probably not, but as const fn get more powerful and allow unsafe code, that seems very possible to me. #66302 is a step in that direction. At that point CTFE relies on dynamic checks (at CTFE evaluation time), which Miri of course doesn't do as it runs run-time code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now, probably not, but as const fn get more powerful and allow unsafe code, that seems very possible to me.

Yikes - I wasn't aware we'll one day have unsafe code in const fn!

Well we might have to expand what find_fn can return, and the name might have to change reflecting that.

Ok. I'm going to be unavailable for the next week but will follow up on rust-lang/miri#1081 on my return.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right now, probably not, but as const fn get more powerful and allow unsafe code, that seems very possible to me

If we ever allowed (without it being UB) you to mutate or read mutable state in const fn, we couldn't ever do a MIR optimization that evals a const fn call where all args are known at compile-time. Also it would allow constants to read from global mutable state in its original state.

There's no need for dynamic checks if we do post monomorphization checks for this situation.

Copy link
Member

Choose a reason for hiding this comment

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

If we ever allowed (without it being UB) you to mutate or read mutable state in const fn, we couldn't ever do a MIR optimization that evals a const fn call where all args are known at compile-time. Also it would allow constants to read from global mutable state in its original state.

We certainly shouldn't allow that during CTFE, but that's not what I talked about. I am talking about Miri-the-standalone-tool.

There's no need for dynamic checks if we do post monomorphization checks for this situation.

Now I am very confused, the dynamic checks are post-monomorphization? Both are the same thing to me in this context. Also I thought we all agreed that we should check everything dynamically so that even "Miri unleashed" is sound?

I thought we had consensus that the dynamic check described all the way at the bottom here should definitely be added. (Not that that is very relevant to this PR, but you brought it up.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, I don't remember what I meant by that.

@bors
Copy link
Contributor

bors commented Nov 28, 2019

⌛ Testing commit a28fbd4 with merge 2539b5f...

bors added a commit that referenced this pull request Nov 28, 2019
Add memoization for const function evaluations

When a const function is being evaluated, as long as all its arguments are zero-sized-types (or it has no arguments) then we can trivially memoize the evaluation result using the existing query mechanism.

With thanks to @oli-obk for mentoring me through this at RustFest Barcelona.

r? @oli-obk
@bors
Copy link
Contributor

bors commented Nov 28, 2019

☀️ Test successful - checks-azure
Approved by: oli-obk
Pushing 2539b5f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 28, 2019
@bors bors merged commit a28fbd4 into rust-lang:master Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.