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

Replace fragile erroneous const sys #70820

Merged
merged 11 commits into from
Apr 24, 2020

Conversation

spastorino
Copy link
Member

@spastorino spastorino commented Apr 5, 2020

Closes #67191

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 5, 2020
@rust-lang rust-lang deleted a comment from rust-highfive Apr 5, 2020
@spastorino spastorino force-pushed the replace-fragile-erroneous-const-sys branch from 49b1b19 to 522a0e2 Compare April 5, 2020 17:11
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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.
2020-04-05T17:11:48.1554234Z ========================== Starting Command Output ===========================
2020-04-05T17:11:48.1556348Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/480b2068-de31-4cda-8f0b-db748f4fb453.sh
2020-04-05T17:11:48.1556552Z 
2020-04-05T17:11:48.1560020Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-05T17:11:48.1582523Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-05T17:11:48.1585203Z Task         : Get sources
2020-04-05T17:11:48.1585531Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-05T17:11:48.1585757Z Version      : 1.0.0
2020-04-05T17:11:48.1585907Z Author       : Microsoft
---
2020-04-05T17:11:49.1634834Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-05T17:11:49.1643647Z ##[command]git config gc.auto 0
2020-04-05T17:11:49.1652124Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-05T17:11:49.1661789Z ##[command]git config --get-all http.proxy
2020-04-05T17:11:49.1672855Z ##[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/70820/merge:refs/remotes/pull/70820/merge
---
2020-04-05T17:13:53.5273328Z Looks like docker image is the same as before, not uploading
2020-04-05T17:14:01.7159671Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-05T17:14:01.7532511Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-05T17:14:01.7559645Z == clock drift check ==
2020-04-05T17:14:01.7566860Z   local time: Sun Apr  5 17:14:01 UTC 2020
2020-04-05T17:14:02.0466858Z   network time: Sun, 05 Apr 2020 17:14:02 GMT
2020-04-05T17:14:02.0491868Z Starting sccache server...
2020-04-05T17:14:02.1207582Z configure: processing command line
2020-04-05T17:14:02.1207810Z configure: 
2020-04-05T17:14:02.1208604Z configure: rust.dist-src        := False
---
2020-04-05T17:19:01.1866190Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-05T17:19:02.5894455Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-05T17:19:04.0255918Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-05T17:19:05.6365268Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-05T17:19:13.3541104Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-05T17:19:16.2739498Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-05T17:19:20.4862980Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-05T17:19:24.3430824Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-05T17:19:32.9632932Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-05T17:40:18.6710406Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-05T17:40:20.3110060Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-05T17:40:22.0846373Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-05T17:40:24.3854103Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-05T17:40:33.7487701Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-05T17:40:37.0958950Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-05T17:40:42.0183409Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-05T17:40:47.1886467Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-05T17:40:56.7681891Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-05T18:04:14.5922851Z .................................................................................................... 1700/9877
2020-04-05T18:04:18.2032609Z .................................................................................................... 1800/9877
2020-04-05T18:04:25.9909481Z .................................................................................................i.. 1900/9877
2020-04-05T18:04:32.9961258Z .................................................................................................... 2000/9877
2020-04-05T18:04:38.6330939Z .......................................................................................iiiii........ 2100/9877
2020-04-05T18:04:57.3108668Z .................................................................................................... 2300/9877
2020-04-05T18:04:59.1142423Z .................................................................................................... 2400/9877
2020-04-05T18:05:01.0236619Z .................................................................................................... 2500/9877
2020-04-05T18:05:06.4919900Z .................................................................................................... 2600/9877
---
2020-04-05T18:07:41.0351080Z .............................................................i...............i...................... 5000/9877
2020-04-05T18:07:48.0007596Z .................................................................................................... 5100/9877
2020-04-05T18:07:54.8251660Z .................................................................................................... 5200/9877
2020-04-05T18:07:59.5670201Z ......i............................................................................................. 5300/9877
2020-04-05T18:08:08.7051566Z ...............................................................................................ii.ii 5400/9877
2020-04-05T18:08:13.1944997Z ........i...i....................................................................................... 5500/9877
2020-04-05T18:08:21.1356152Z ........................................i........................................................... 5700/9877
2020-04-05T18:08:21.1356152Z ........................................i........................................................... 5700/9877
2020-04-05T18:08:29.9919515Z ............................................................ii.....................................i 5800/9877
2020-04-05T18:08:41.1714160Z .................................................................................................... 6000/9877
2020-04-05T18:08:41.1714160Z .................................................................................................... 6000/9877
2020-04-05T18:08:49.7525942Z .............................................................................................ii...i. 6100/9877
2020-04-05T18:09:00.3939951Z .ii...........i..................................................................................... 6200/9877
2020-04-05T18:09:15.4813019Z .................................................................................................... 6400/9877
2020-04-05T18:09:20.3857660Z .................................................................................................... 6500/9877
2020-04-05T18:09:20.3857660Z .................................................................................................... 6500/9877
2020-04-05T18:09:34.4517092Z .......................i..ii........................................................................ 6600/9877
2020-04-05T18:09:53.0429114Z .................................................................................................... 6800/9877
2020-04-05T18:09:54.8228616Z .......................i............................................................................ 6900/9877
2020-04-05T18:09:56.5964376Z .................................................................................................... 7000/9877
2020-04-05T18:09:58.4897285Z ..............................................................i..................................... 7100/9877
---
2020-04-05T18:11:26.9071254Z .................................................................................................... 7800/9877
2020-04-05T18:11:30.8332989Z .................................................................................................... 7900/9877
2020-04-05T18:11:36.1107163Z .................................................................................................... 8000/9877
2020-04-05T18:11:42.9234335Z ..........................i......................................................................... 8100/9877
2020-04-05T18:11:50.8324241Z ...........................................................................iiiiiiiiii.i............. 8200/9877
2020-04-05T18:12:05.7387064Z ...................i......i......................................................................... 8400/9877
2020-04-05T18:12:10.4260128Z .................................................................................................... 8500/9877
2020-04-05T18:12:20.7466999Z .................................................................................................... 8600/9877
2020-04-05T18:12:32.5664532Z .................................................................................................... 8700/9877
---
2020-04-05T18:14:18.2655776Z 
2020-04-05T18:14:18.2656577Z ---- [ui] ui/consts/assoc_const_generic_impl.rs stdout ----
2020-04-05T18:14:18.2657059Z diff of stderr:
2020-04-05T18:14:18.2657570Z 
2020-04-05T18:14:18.2657926Z 18 LL |         let () = Self::I_AM_ZERO_SIZED;
2020-04-05T18:14:18.2658686Z 20 
2020-04-05T18:14:18.2659374Z - error: aborting due to previous error
2020-04-05T18:14:18.2659871Z + error: erroneous constant encountered
2020-04-05T18:14:18.2660515Z +   --> $DIR/assoc_const_generic_impl.rs:13:18
2020-04-05T18:14:18.2660515Z +   --> $DIR/assoc_const_generic_impl.rs:13:18
2020-04-05T18:14:18.2661071Z +    |
2020-04-05T18:14:18.2661650Z + LL |         let () = Self::I_AM_ZERO_SIZED;
2020-04-05T18:14:18.2662629Z + 
2020-04-05T18:14:18.2662983Z + error: aborting due to 2 previous errors
2020-04-05T18:14:18.2663323Z 22 
2020-04-05T18:14:18.2663588Z 23 
2020-04-05T18:14:18.2663588Z 23 
2020-04-05T18:14:18.2663850Z 
2020-04-05T18:14:18.2664092Z 
2020-04-05T18:14:18.2664441Z The actual stderr differed from the expected stderr.
2020-04-05T18:14:18.2665547Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/assoc_const_generic_impl/assoc_const_generic_impl.stderr
2020-04-05T18:14:18.2666748Z To update references, rerun the tests and pass the `--bless` flag
2020-04-05T18:14:18.2667717Z To only update this specific test, also pass `--test-args consts/assoc_const_generic_impl.rs`
2020-04-05T18:14:18.2668514Z error: 1 errors occurred comparing output.
2020-04-05T18:14:18.2668881Z status: exit code: 1
2020-04-05T18:14:18.2668881Z status: exit code: 1
2020-04-05T18:14:18.2672573Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/assoc_const_generic_impl.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/assoc_const_generic_impl" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/assoc_const_generic_impl/auxiliary"
2020-04-05T18:14:18.2675636Z ------------------------------------------
2020-04-05T18:14:18.2675946Z 
2020-04-05T18:14:18.2679413Z ------------------------------------------
2020-04-05T18:14:18.2681464Z stderr:
2020-04-05T18:14:18.2681464Z stderr:
2020-04-05T18:14:18.2682200Z ------------------------------------------
2020-04-05T18:14:18.2683385Z warning: any use of this value will cause an error
2020-04-05T18:14:18.2685223Z   --> /checkout/src/test/ui/consts/assoc_const_generic_impl.rs:11:34
2020-04-05T18:14:18.2686040Z    |
2020-04-05T18:14:18.2686541Z LL |     const I_AM_ZERO_SIZED: ()  = [()][std::mem::size_of::<Self>()]; //~ WARN any use of this value
2020-04-05T18:14:18.2688547Z    |                                  |
2020-04-05T18:14:18.2689452Z    |                                  index out of bounds: the len is 1 but the index is 4
2020-04-05T18:14:18.2689909Z    |
2020-04-05T18:14:18.2690222Z note: the lint level is defined here
---
2020-04-05T18:14:18.2692269Z 
2020-04-05T18:14:18.2692881Z error: erroneous constant encountered
2020-04-05T18:14:18.2694423Z   --> /checkout/src/test/ui/consts/assoc_const_generic_impl.rs:13:18
2020-04-05T18:14:18.2694689Z    |
2020-04-05T18:14:18.2694957Z LL |         let () = Self::I_AM_ZERO_SIZED; //~ ERROR erroneous constant encountered
2020-04-05T18:14:18.2696067Z 
2020-04-05T18:14:18.2696294Z error: erroneous constant encountered
2020-04-05T18:14:18.2699460Z   --> /checkout/src/test/ui/consts/assoc_const_generic_impl.rs:13:18
2020-04-05T18:14:18.2700375Z    |
2020-04-05T18:14:18.2700375Z    |
2020-04-05T18:14:18.2701224Z LL |         let () = Self::I_AM_ZERO_SIZED; //~ ERROR erroneous constant encountered
2020-04-05T18:14:18.2702590Z 
2020-04-05T18:14:18.2703018Z error: aborting due to 2 previous errors
2020-04-05T18:14:18.2703379Z 
2020-04-05T18:14:18.2703482Z 
2020-04-05T18:14:18.2703482Z 
2020-04-05T18:14:18.2704065Z ------------------------------------------
2020-04-05T18:14:18.2704251Z 
2020-04-05T18:14:18.2704351Z 
2020-04-05T18:14:18.2704823Z ---- [ui] ui/consts/const-eval/index-out-of-bounds-never-type.rs stdout ----
2020-04-05T18:14:18.2705136Z diff of stderr:
2020-04-05T18:14:18.2705266Z 
2020-04-05T18:14:18.2705486Z 18 LL |     let _ = PrintName::<T>::VOID;
2020-04-05T18:14:18.2709533Z 20 
2020-04-05T18:14:18.2710045Z - error: aborting due to previous error
2020-04-05T18:14:18.2710313Z + error: erroneous constant encountered
2020-04-05T18:14:18.2711134Z +   --> $DIR/index-out-of-bounds-never-type.rs:15:13
2020-04-05T18:14:18.2711134Z +   --> $DIR/index-out-of-bounds-never-type.rs:15:13
2020-04-05T18:14:18.2711374Z +    |
2020-04-05T18:14:18.2711580Z + LL |     let _ = PrintName::<T>::VOID;
2020-04-05T18:14:18.2712029Z + 
2020-04-05T18:14:18.2712219Z + error: aborting due to 2 previous errors
2020-04-05T18:14:18.2712562Z 22 
2020-04-05T18:14:18.2712692Z 23 
2020-04-05T18:14:18.2712692Z 23 
2020-04-05T18:14:18.2712788Z 
2020-04-05T18:14:18.2712875Z 
2020-04-05T18:14:18.2713063Z The actual stderr differed from the expected stderr.
2020-04-05T18:14:18.2713787Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/index-out-of-bounds-never-type/index-out-of-bounds-never-type.stderr
2020-04-05T18:14:18.2714425Z To update references, rerun the tests and pass the `--bless` flag
2020-04-05T18:14:18.2715035Z To only update this specific test, also pass `--test-args consts/const-eval/index-out-of-bounds-never-type.rs`
2020-04-05T18:14:18.2715477Z error: 1 errors occurred comparing output.
2020-04-05T18:14:18.2715693Z status: exit code: 1
2020-04-05T18:14:18.2715693Z status: exit code: 1
2020-04-05T18:14:18.2719461Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/index-out-of-bounds-never-type" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/index-out-of-bounds-never-type/auxiliary"
2020-04-05T18:14:18.2721196Z ------------------------------------------
2020-04-05T18:14:18.2721367Z 
2020-04-05T18:14:18.2721725Z ------------------------------------------
2020-04-05T18:14:18.2721916Z stderr:
2020-04-05T18:14:18.2721916Z stderr:
2020-04-05T18:14:18.2722256Z ------------------------------------------
2020-04-05T18:14:18.2722531Z warning: any use of this value will cause an error
2020-04-05T18:14:18.2723095Z   --> /checkout/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs:10:61
2020-04-05T18:14:18.2723376Z    |
2020-04-05T18:14:18.2723666Z LL |     const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
2020-04-05T18:14:18.2724839Z    |                                                             |
2020-04-05T18:14:18.2725307Z    |                                                             index out of bounds: the len is 0 but the index is 0
2020-04-05T18:14:18.2725652Z    |
2020-04-05T18:14:18.2725834Z note: the lint level is defined here
---
2020-04-05T18:14:18.2727280Z 
2020-04-05T18:14:18.2727451Z error: erroneous constant encountered
2020-04-05T18:14:18.2728080Z   --> /checkout/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs:15:13
2020-04-05T18:14:18.2728382Z    |
2020-04-05T18:14:18.2728578Z LL |     let _ = PrintName::<T>::VOID;
2020-04-05T18:14:18.2729155Z 
2020-04-05T18:14:18.2729320Z error: erroneous constant encountered
2020-04-05T18:14:18.2729850Z   --> /checkout/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs:15:13
2020-04-05T18:14:18.2730114Z    |
2020-04-05T18:14:18.2730114Z    |
2020-04-05T18:14:18.2730321Z LL |     let _ = PrintName::<T>::VOID;
2020-04-05T18:14:18.2731117Z 
2020-04-05T18:14:18.2731330Z error: aborting due to 2 previous errors
2020-04-05T18:14:18.2731508Z 
2020-04-05T18:14:18.2731609Z 
---
2020-04-05T18:14:18.2736844Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-04-05T18:14:18.2737368Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-04-05T18:14:18.2737588Z 
2020-04-05T18:14:18.2739487Z 
2020-04-05T18:14:18.2744039Z 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-7/bin/FileCheck" "--nodejs" "/usr/bin/node" "--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" "7.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-04-05T18:14:18.2746683Z 
2020-04-05T18:14:18.2746776Z 
2020-04-05T18:14:18.2747297Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-04-05T18:14:18.2747652Z Build completed unsuccessfully in 0:58:35
2020-04-05T18:14:18.2747652Z Build completed unsuccessfully in 0:58:35
2020-04-05T18:14:18.2779064Z == clock drift check ==
2020-04-05T18:14:18.2804037Z   local time: Sun Apr  5 18:14:18 UTC 2020
2020-04-05T18:14:18.5752207Z   network time: Sun, 05 Apr 2020 18:14:18 GMT
2020-04-05T18:14:19.0394123Z 
2020-04-05T18:14:19.0394123Z 
2020-04-05T18:14:19.0461837Z ##[error]Bash exited with code '1'.
2020-04-05T18:14:19.0473977Z ##[section]Finishing: Run build
2020-04-05T18:14:19.0524125Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-05T18:14:19.0529712Z Task         : Get sources
2020-04-05T18:14:19.0530312Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-05T18:14:19.0530594Z Version      : 1.0.0
2020-04-05T18:14:19.0530954Z Author       : Microsoft
2020-04-05T18:14:19.0530954Z Author       : Microsoft
2020-04-05T18:14:19.0531254Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-05T18:14:19.0531621Z ==============================================================================
2020-04-05T18:14:19.3547049Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-05T18:14:19.3594122Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-05T18:14:19.3676041Z Cleaning up task key
2020-04-05T18:14:19.3677572Z Start cleaning up orphan processes.
2020-04-05T18:14:19.3836080Z Terminate orphan process: pid (3942) (python)
2020-04-05T18:14:19.4026672Z ##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@@ -190,6 +191,18 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(

fx.per_local_var_debug_info = fx.compute_per_local_var_debug_info();

for const_ in &mir.uneval_consts {
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming this PR is addressing #67191, it seems like the way this PR is setup, then cargo check (--emit metadata) would not trigger an error here but it should. In other words, erroneous live constants should be caught in analysis before optimizations.

Copy link
Contributor

Choose a reason for hiding this comment

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

yea, we need to go through this list in the collector, too, just like we're doing with in-MIR constants right now. This may get solved automatically by extending the mir visitors to go through the constants in the list via visit_const

Copy link
Member Author

Choose a reason for hiding this comment

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

Added this here 2f8c3b5

Copy link
Contributor

Choose a reason for hiding this comment

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

@oli-obk I don't follow how this was resolved. The code was added to monomorphization logic, but presumably that never runs if we don't reach codegen?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see how cargo check can trigger an error on these without monomorphization. If you look at the test that we're doing all these changes for (https://github.com/rust-lang/rust/blob/master/src/test/ui/consts/assoc_const_generic_impl.rs) you see that without monomorphization we can't possibly report anything. This is inherently a monomorphization time thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

this applies to all other lints reported during mir optimizations, too. Const prop lints for example aren't triggered reliably from cargo check. Only if the optimized_mir query is called for a function, will const prop lints actually get reported. We could add optimized_mir runs for all functions to the analysis query though. In that case we'd also do a best effort evaluation of all constants

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that I feel that running optimized_mir on all functions for analysis is an orthogonal discussion to this PR and we should probably move it to an issue if you think this is a useful thing to do at all (it will make cargo check take more time as optimizations are run)

Copy link
Contributor

Choose a reason for hiding this comment

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

Well this is all very unfortunate... I had neglected associated constants. With them in mind, the options as I see them are:

  1. Error differently for polymorphic and monomorphic constants, doing the former post-monomorphization, and the latter pre-monomorphization (inconsistent).

  2. Error for both post-monomorphization. (I consider all post-monomorphization errors to be language design bugs.)

  3. Error for neither and insert a trap in codegen, but @RalfJung would probably be even more unhappy about that.

  4. Only insert a trap for polymorphic constants (inconsistent).

Copy link
Contributor

Choose a reason for hiding this comment

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

We are doing 1. right now. Erroring post monomorphization for associated constants is what we do to keep our APIs sane. Otherwise we'd need integer range bounds and more just to be able to do simple addition of associated constants inside other associated constants.

I don't like 3 and 4 and am not even sure that 2. is implementable 🤣

What we could do at some point in the future is to create a lint that tells you about sites where post monomorphization errors could occur depending on the generic parameters that were given, but that would require symbolic execution of constants and some sort of solver (not necessarily SAT) for them. While that is something we need for more advanced const generics trickeries anyway, I think we can just stay with option 1 until we address post monomorphization errors in general.

Copy link
Contributor

Choose a reason for hiding this comment

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

We are doing 1. right now. Erroring post monomorphization for associated constants is what we do to keep our APIs sane. Otherwise we'd need integer range bounds and more just to be able to do simple addition of associated constants inside other associated constants.

Yea, this is going to be ungreat for the language spec and inconsistent, but of the bad choices I suppose it's the least bad (😭), so do your thing. :)

@spastorino spastorino force-pushed the replace-fragile-erroneous-const-sys branch from 522a0e2 to b98aedd Compare April 6, 2020 05:08
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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.
2020-04-06T05:09:18.9321153Z ========================== Starting Command Output ===========================
2020-04-06T05:09:18.9323421Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/542c9d61-ae71-45c7-9757-d31aedc8ec3e.sh
2020-04-06T05:09:18.9323637Z 
2020-04-06T05:09:18.9328102Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-06T05:09:18.9345305Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-06T05:09:18.9349098Z Task         : Get sources
2020-04-06T05:09:18.9349334Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-06T05:09:18.9349560Z Version      : 1.0.0
2020-04-06T05:09:18.9349756Z Author       : Microsoft
---
2020-04-06T05:09:20.1536268Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-06T05:09:20.1543339Z ##[command]git config gc.auto 0
2020-04-06T05:09:20.1547842Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-06T05:09:20.1551211Z ##[command]git config --get-all http.proxy
2020-04-06T05:09:20.1557741Z ##[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/70820/merge:refs/remotes/pull/70820/merge
---
2020-04-06T05:11:16.5441804Z Looks like docker image is the same as before, not uploading
2020-04-06T05:11:23.9696416Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-06T05:11:24.0085321Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-06T05:11:24.0128627Z == clock drift check ==
2020-04-06T05:11:24.1720927Z   local time: Mon Apr  6 05:11:24 UTC 2020
2020-04-06T05:11:24.1721211Z   network time: Mon, 06 Apr 2020 05:11:24 GMT
2020-04-06T05:11:24.1748518Z Starting sccache server...
2020-04-06T05:11:24.2473350Z configure: processing command line
2020-04-06T05:11:24.2473945Z configure: 
2020-04-06T05:11:24.2474856Z configure: rust.dist-src        := False
---
2020-04-06T05:15:57.9664114Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-06T05:15:59.7663893Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-06T05:16:00.7858161Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-06T05:16:01.9327437Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-06T05:16:09.8331199Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-06T05:16:11.9015724Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-06T05:16:15.8264447Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-06T05:16:19.5997098Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-06T05:16:28.0265270Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-06T05:39:43.3838527Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-06T05:39:45.0499930Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-06T05:39:46.8409514Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-06T05:39:48.7982393Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-06T05:39:58.1897616Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-06T05:40:01.2506008Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-06T05:40:06.3490697Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-06T05:40:11.2748555Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-06T05:40:20.5364753Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-06T06:03:37.1914167Z .................................................................................................... 1700/9877
2020-04-06T06:03:41.1566376Z .................................................................................................... 1800/9877
2020-04-06T06:03:50.0146500Z .................................................................................................i.. 1900/9877
2020-04-06T06:03:57.9214504Z .................................................................................................... 2000/9877
2020-04-06T06:04:04.3953070Z .......................................................................................iiiii........ 2100/9877
2020-04-06T06:04:25.8650091Z .................................................................................................... 2300/9877
2020-04-06T06:04:28.0809516Z .................................................................................................... 2400/9877
2020-04-06T06:04:30.3765786Z .................................................................................................... 2500/9877
2020-04-06T06:04:36.3871843Z .................................................................................................... 2600/9877
---
2020-04-06T06:07:34.2644009Z .............................................................i...............i...................... 5000/9877
2020-04-06T06:07:41.6733126Z .................................................................................................... 5100/9877
2020-04-06T06:07:49.2415621Z .................................................................................................... 5200/9877
2020-04-06T06:07:54.4967089Z ......i............................................................................................. 5300/9877
2020-04-06T06:08:04.4892033Z ...............................................................................................ii.ii 5400/9877
2020-04-06T06:08:09.4041934Z ........i...i....................................................................................... 5500/9877
2020-04-06T06:08:18.0528040Z ........................................i........................................................... 5700/9877
2020-04-06T06:08:18.0528040Z ........................................i........................................................... 5700/9877
2020-04-06T06:08:27.7497767Z ............................................................ii.....................................i 5800/9877
2020-04-06T06:08:40.0260973Z .................................................................................................... 6000/9877
2020-04-06T06:08:40.0260973Z .................................................................................................... 6000/9877
2020-04-06T06:08:49.8058573Z .............................................................................................ii...i. 6100/9877
2020-04-06T06:09:01.7249872Z .ii...........i..................................................................................... 6200/9877
2020-04-06T06:09:18.6722939Z .................................................................................................... 6400/9877
2020-04-06T06:09:24.1978896Z .................................................................................................... 6500/9877
2020-04-06T06:09:24.1978896Z .................................................................................................... 6500/9877
2020-04-06T06:09:38.8890929Z .......................i..ii........................................................................ 6600/9877
2020-04-06T06:09:59.1958278Z .................................................................................................... 6800/9877
2020-04-06T06:10:01.1725001Z .......................i............................................................................ 6900/9877
2020-04-06T06:10:03.1708673Z .................................................................................................... 7000/9877
2020-04-06T06:10:05.2902579Z ..............................................................i..................................... 7100/9877
---
2020-04-06T06:11:32.0524818Z .................................................................................................... 7800/9877
2020-04-06T06:11:35.8299891Z .................................................................................................... 7900/9877
2020-04-06T06:11:40.7481863Z .................................................................................................... 8000/9877
2020-04-06T06:11:47.2239666Z ..........................i......................................................................... 8100/9877
2020-04-06T06:11:54.2927972Z ...........................................................................iiiiiiiiii.i............. 8200/9877
2020-04-06T06:12:07.8172165Z ...................i......i......................................................................... 8400/9877
2020-04-06T06:12:11.8080107Z .................................................................................................... 8500/9877
2020-04-06T06:12:21.0062445Z .................................................................................................... 8600/9877
2020-04-06T06:12:31.7872834Z .................................................................................................... 8700/9877
---
2020-04-06T06:14:11.6265640Z 
2020-04-06T06:14:11.6266508Z ---- [ui] ui/consts/assoc_const_generic_impl.rs stdout ----
2020-04-06T06:14:11.6266924Z diff of stderr:
2020-04-06T06:14:11.6267129Z 
2020-04-06T06:14:11.6267401Z 18 LL |         let () = Self::I_AM_ZERO_SIZED;
2020-04-06T06:14:11.6268164Z 20 
2020-04-06T06:14:11.6268764Z - error: aborting due to previous error
2020-04-06T06:14:11.6269092Z + error: erroneous constant encountered
2020-04-06T06:14:11.6269559Z +   --> $DIR/assoc_const_generic_impl.rs:13:18
2020-04-06T06:14:11.6269559Z +   --> $DIR/assoc_const_generic_impl.rs:13:18
2020-04-06T06:14:11.6269832Z +    |
2020-04-06T06:14:11.6270114Z + LL |         let () = Self::I_AM_ZERO_SIZED;
2020-04-06T06:14:11.6270656Z + 
2020-04-06T06:14:11.6270905Z + error: aborting due to 2 previous errors
2020-04-06T06:14:11.6271133Z 22 
2020-04-06T06:14:11.6271307Z 23 
2020-04-06T06:14:11.6271307Z 23 
2020-04-06T06:14:11.6271485Z 
2020-04-06T06:14:11.6271640Z 
2020-04-06T06:14:11.6271877Z The actual stderr differed from the expected stderr.
2020-04-06T06:14:11.6272545Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/assoc_const_generic_impl/assoc_const_generic_impl.stderr
2020-04-06T06:14:11.6273189Z To update references, rerun the tests and pass the `--bless` flag
2020-04-06T06:14:11.6273795Z To only update this specific test, also pass `--test-args consts/assoc_const_generic_impl.rs`
2020-04-06T06:14:11.6274325Z error: 1 errors occurred comparing output.
2020-04-06T06:14:11.6274600Z status: exit code: 1
2020-04-06T06:14:11.6274600Z status: exit code: 1
2020-04-06T06:14:11.6276327Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/assoc_const_generic_impl.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/assoc_const_generic_impl" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/assoc_const_generic_impl/auxiliary"
2020-04-06T06:14:11.6277906Z ------------------------------------------
2020-04-06T06:14:11.6278144Z 
2020-04-06T06:14:11.6278551Z ------------------------------------------
2020-04-06T06:14:11.6278811Z stderr:
2020-04-06T06:14:11.6278811Z stderr:
2020-04-06T06:14:11.6279208Z ------------------------------------------
2020-04-06T06:14:11.6279531Z warning: any use of this value will cause an error
2020-04-06T06:14:11.6280044Z   --> /checkout/src/test/ui/consts/assoc_const_generic_impl.rs:11:34
2020-04-06T06:14:11.6280378Z    |
2020-04-06T06:14:11.6280720Z LL |     const I_AM_ZERO_SIZED: ()  = [()][std::mem::size_of::<Self>()]; //~ WARN any use of this value
2020-04-06T06:14:11.6281675Z    |                                  |
2020-04-06T06:14:11.6282037Z    |                                  index out of bounds: the len is 1 but the index is 4
2020-04-06T06:14:11.6282370Z    |
2020-04-06T06:14:11.6282594Z note: the lint level is defined here
---
2020-04-06T06:14:11.6284063Z 
2020-04-06T06:14:11.6284283Z error: erroneous constant encountered
2020-04-06T06:14:11.6285053Z   --> /checkout/src/test/ui/consts/assoc_const_generic_impl.rs:13:18
2020-04-06T06:14:11.6285413Z    |
2020-04-06T06:14:11.6285764Z LL |         let () = Self::I_AM_ZERO_SIZED; //~ ERROR erroneous constant encountered
2020-04-06T06:14:11.6287829Z 
2020-04-06T06:14:11.6288240Z error: erroneous constant encountered
2020-04-06T06:14:11.6288868Z   --> /checkout/src/test/ui/consts/assoc_const_generic_impl.rs:13:18
2020-04-06T06:14:11.6289185Z    |
2020-04-06T06:14:11.6289185Z    |
2020-04-06T06:14:11.6289499Z LL |         let () = Self::I_AM_ZERO_SIZED; //~ ERROR erroneous constant encountered
2020-04-06T06:14:11.6290892Z 
2020-04-06T06:14:11.6291032Z error: aborting due to 2 previous errors
2020-04-06T06:14:11.6291175Z 
2020-04-06T06:14:11.6291248Z 
2020-04-06T06:14:11.6291248Z 
2020-04-06T06:14:11.6291597Z ------------------------------------------
2020-04-06T06:14:11.6291726Z 
2020-04-06T06:14:11.6291797Z 
2020-04-06T06:14:11.6292156Z ---- [ui] ui/consts/const-eval/index-out-of-bounds-never-type.rs stdout ----
2020-04-06T06:14:11.6292365Z diff of stderr:
2020-04-06T06:14:11.6292456Z 
2020-04-06T06:14:11.6292626Z 18 LL |     let _ = PrintName::<T>::VOID;
2020-04-06T06:14:11.6292971Z 20 
2020-04-06T06:14:11.6293259Z - error: aborting due to previous error
2020-04-06T06:14:11.6293452Z + error: erroneous constant encountered
2020-04-06T06:14:11.6293805Z +   --> $DIR/index-out-of-bounds-never-type.rs:15:13
2020-04-06T06:14:11.6293805Z +   --> $DIR/index-out-of-bounds-never-type.rs:15:13
2020-04-06T06:14:11.6293980Z +    |
2020-04-06T06:14:11.6294156Z + LL |     let _ = PrintName::<T>::VOID;
2020-04-06T06:14:11.6294491Z + 
2020-04-06T06:14:11.6294653Z + error: aborting due to 2 previous errors
2020-04-06T06:14:11.6294797Z 22 
2020-04-06T06:14:11.6294887Z 23 
2020-04-06T06:14:11.6294887Z 23 
2020-04-06T06:14:11.6294981Z 
2020-04-06T06:14:11.6295052Z 
2020-04-06T06:14:11.6295203Z The actual stderr differed from the expected stderr.
2020-04-06T06:14:11.6296070Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/index-out-of-bounds-never-type/index-out-of-bounds-never-type.stderr
2020-04-06T06:14:11.6296751Z To update references, rerun the tests and pass the `--bless` flag
2020-04-06T06:14:11.6297438Z To only update this specific test, also pass `--test-args consts/const-eval/index-out-of-bounds-never-type.rs`
2020-04-06T06:14:11.6297834Z error: 1 errors occurred comparing output.
2020-04-06T06:14:11.6298021Z status: exit code: 1
2020-04-06T06:14:11.6298021Z status: exit code: 1
2020-04-06T06:14:11.6299654Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/index-out-of-bounds-never-type" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/index-out-of-bounds-never-type/auxiliary"
2020-04-06T06:14:11.6301782Z ------------------------------------------
2020-04-06T06:14:11.6301916Z 
2020-04-06T06:14:11.6302183Z ------------------------------------------
2020-04-06T06:14:11.6302330Z stderr:
2020-04-06T06:14:11.6302330Z stderr:
2020-04-06T06:14:11.6304176Z ------------------------------------------
2020-04-06T06:14:11.6304446Z warning: any use of this value will cause an error
2020-04-06T06:14:11.6305147Z   --> /checkout/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs:10:61
2020-04-06T06:14:11.6305581Z    |
2020-04-06T06:14:11.6305809Z LL |     const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
2020-04-06T06:14:11.6306598Z    |                                                             |
2020-04-06T06:14:11.6306975Z    |                                                             index out of bounds: the len is 0 but the index is 0
2020-04-06T06:14:11.6307278Z    |
2020-04-06T06:14:11.6307427Z note: the lint level is defined here
---
2020-04-06T06:14:11.6308505Z 
2020-04-06T06:14:11.6308837Z error: erroneous constant encountered
2020-04-06T06:14:11.6309259Z   --> /checkout/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs:15:13
2020-04-06T06:14:11.6309474Z    |
2020-04-06T06:14:11.6309645Z LL |     let _ = PrintName::<T>::VOID;
2020-04-06T06:14:11.6309959Z 
2020-04-06T06:14:11.6310096Z error: erroneous constant encountered
2020-04-06T06:14:11.6310542Z   --> /checkout/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs:15:13
2020-04-06T06:14:11.6310755Z    |
2020-04-06T06:14:11.6310755Z    |
2020-04-06T06:14:11.6310906Z LL |     let _ = PrintName::<T>::VOID;
2020-04-06T06:14:11.6311237Z 
2020-04-06T06:14:11.6311375Z error: aborting due to 2 previous errors
2020-04-06T06:14:11.6311501Z 
2020-04-06T06:14:11.6311589Z 
---
2020-04-06T06:14:11.6314655Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-04-06T06:14:11.6315045Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-04-06T06:14:11.6315217Z 
2020-04-06T06:14:11.6315288Z 
2020-04-06T06:14:11.6318114Z 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-7/bin/FileCheck" "--nodejs" "/usr/bin/node" "--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" "7.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-04-06T06:14:11.6320122Z 
2020-04-06T06:14:11.6320211Z 
2020-04-06T06:14:11.6322566Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-04-06T06:14:11.6322858Z Build completed unsuccessfully in 1:01:23
2020-04-06T06:14:11.6322858Z Build completed unsuccessfully in 1:01:23
2020-04-06T06:14:11.6352104Z == clock drift check ==
2020-04-06T06:14:11.6368932Z   local time: Mon Apr  6 06:14:11 UTC 2020
2020-04-06T06:14:11.8045699Z   network time: Mon, 06 Apr 2020 06:14:11 GMT
2020-04-06T06:14:12.7134157Z 
2020-04-06T06:14:12.7134157Z 
2020-04-06T06:14:12.7206837Z ##[error]Bash exited with code '1'.
2020-04-06T06:14:12.7218126Z ##[section]Finishing: Run build
2020-04-06T06:14:12.7258448Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-06T06:14:12.7263000Z Task         : Get sources
2020-04-06T06:14:12.7263253Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-06T06:14:12.7263507Z Version      : 1.0.0
2020-04-06T06:14:12.7263670Z Author       : Microsoft
2020-04-06T06:14:12.7263670Z Author       : Microsoft
2020-04-06T06:14:12.7264117Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-06T06:14:12.7264452Z ==============================================================================
2020-04-06T06:14:13.0101789Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-06T06:14:13.0138531Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-06T06:14:13.0214013Z Cleaning up task key
2020-04-06T06:14:13.0214990Z Start cleaning up orphan processes.
2020-04-06T06:14:13.0360005Z Terminate orphan process: pid (3964) (python)
2020-04-06T06:14:13.0492971Z ##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@spastorino
Copy link
Member Author

@oli-obk I'm not sure if this 6b158c6 is all the stuff we need to cleanup or there's more.

@rust-highfive
Copy link
Collaborator

The job mingw-check 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.
2020-04-06T21:20:18.1624871Z ========================== Starting Command Output ===========================
2020-04-06T21:20:18.1628178Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/c8953652-99ca-4902-880e-735fe2e47cd0.sh
2020-04-06T21:20:18.1628435Z 
2020-04-06T21:20:18.1634286Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-06T21:20:18.1654266Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-06T21:20:18.1657843Z Task         : Get sources
2020-04-06T21:20:18.1658143Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-06T21:20:18.1658571Z Version      : 1.0.0
2020-04-06T21:20:18.1658769Z Author       : Microsoft
---
2020-04-06T21:20:19.1530375Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-06T21:20:19.1542380Z ##[command]git config gc.auto 0
2020-04-06T21:20:19.1550819Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-06T21:20:19.1553981Z ##[command]git config --get-all http.proxy
2020-04-06T21:20:19.1560728Z ##[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/70820/merge:refs/remotes/pull/70820/merge
---
2020-04-06T21:22:43.6688959Z  ---> 3fc1b512c57b
2020-04-06T21:22:43.6689210Z Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
2020-04-06T21:22:43.6693791Z  ---> Using cache
2020-04-06T21:22:43.6694154Z  ---> 5ee4295733f4
2020-04-06T21:22:43.6695457Z Step 7/7 : ENV SCRIPT python2.7 ../x.py test src/tools/expand-yaml-anchors &&            python2.7 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python2.7 ../x.py build --stage 0 src/tools/build-manifest &&            python2.7 ../x.py test --stage 0 src/tools/compiletest &&            python2.7 ../x.py test src/tools/tidy &&            /scripts/validate-toolstate.sh
2020-04-06T21:22:43.6702667Z  ---> 3d07a0fa42fe
2020-04-06T21:22:43.6737068Z Successfully built 3d07a0fa42fe
2020-04-06T21:22:43.6777193Z Successfully tagged rust-ci:latest
2020-04-06T21:22:43.7096042Z Built container sha256:3d07a0fa42feb5754fc13bb2f7010ebe13e4b8b8cdbebed0c75d8da320c8c8ad
2020-04-06T21:22:43.7096042Z Built container sha256:3d07a0fa42feb5754fc13bb2f7010ebe13e4b8b8cdbebed0c75d8da320c8c8ad
2020-04-06T21:22:43.7116795Z Looks like docker image is the same as before, not uploading
2020-04-06T21:22:51.9360439Z [CI_JOB_NAME=mingw-check]
2020-04-06T21:22:51.9588283Z [CI_JOB_NAME=mingw-check]
2020-04-06T21:22:51.9623495Z == clock drift check ==
2020-04-06T21:22:51.9634797Z   local time: Mon Apr  6 21:22:51 UTC 2020
2020-04-06T21:22:52.0268527Z   network time: Mon, 06 Apr 2020 21:22:52 GMT
2020-04-06T21:22:52.0294031Z Starting sccache server...
2020-04-06T21:22:52.1194714Z configure: processing command line
2020-04-06T21:22:52.1195008Z configure: 
2020-04-06T21:22:52.1195819Z configure: rust.parallel-compiler := True
---
2020-04-06T21:26:48.1273541Z     Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-06T21:26:48.2650280Z     Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-06T21:26:48.4722016Z     Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-06T21:26:48.5905561Z     Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-06T21:26:49.1585631Z     Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-06T21:26:51.7498440Z     Checking rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-06T21:26:52.2768211Z     Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-06T21:26:54.5910972Z     Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-06T21:26:55.0480034Z     Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-06T21:27:32.6762250Z     Checking rustc_traits v0.0.0 (/checkout/src/librustc_traits)
2020-04-06T21:27:33.2500490Z error: unused import: `self`
2020-04-06T21:27:33.2501220Z   --> src/librustc_mir/transform/simplify.rs:35:24
2020-04-06T21:27:33.2501739Z    |
2020-04-06T21:27:33.2502397Z 35 | use rustc_middle::ty::{self, TyCtxt};
2020-04-06T21:27:33.2503774Z    |
2020-04-06T21:27:33.2504396Z    = note: `-D unused-imports` implied by `-D warnings`
2020-04-06T21:27:33.2504732Z 
2020-04-06T21:27:33.3034623Z     Checking rustc_mir_build v0.0.0 (/checkout/src/librustc_mir_build)
---
2020-04-06T21:27:40.2378474Z 
2020-04-06T21:27:40.2379281Z To learn more, run the command again with --verbose.
2020-04-06T21:27:40.2379841Z warning: build failed, waiting for other jobs to finish...
2020-04-06T21:27:40.4189875Z error: build failed
2020-04-06T21:27:40.4230907Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
2020-04-06T21:27:40.4232342Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
2020-04-06T21:27:40.4232688Z Build completed unsuccessfully in 0:04:48
2020-04-06T21:27:40.4284456Z == clock drift check ==
2020-04-06T21:27:40.4296102Z   local time: Mon Apr  6 21:27:40 UTC 2020
2020-04-06T21:27:40.4296102Z   local time: Mon Apr  6 21:27:40 UTC 2020
2020-04-06T21:27:40.7198658Z   network time: Mon, 06 Apr 2020 21:27:40 GMT
2020-04-06T21:27:41.4582829Z 
2020-04-06T21:27:41.4582829Z 
2020-04-06T21:27:41.4657841Z ##[error]Bash exited with code '1'.
2020-04-06T21:27:41.4675639Z ##[section]Finishing: Run build
2020-04-06T21:27:41.4734655Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-06T21:27:41.4739919Z Task         : Get sources
2020-04-06T21:27:41.4740310Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-06T21:27:41.4740635Z Version      : 1.0.0
2020-04-06T21:27:41.4740860Z Author       : Microsoft
2020-04-06T21:27:41.4740860Z Author       : Microsoft
2020-04-06T21:27:41.4741260Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-06T21:27:41.4741682Z ==============================================================================
2020-04-06T21:27:41.8543878Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-06T21:27:41.8590682Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-06T21:27:41.8686515Z Cleaning up task key
2020-04-06T21:27:41.8687797Z Start cleaning up orphan processes.
2020-04-06T21:27:41.8889281Z Terminate orphan process: pid (3386) (python)
2020-04-06T21:27:41.9031992Z ##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@spastorino spastorino force-pushed the replace-fragile-erroneous-const-sys branch from 6b158c6 to ca9a5fd Compare April 8, 2020 13:24
@rust-highfive
Copy link
Collaborator

The job mingw-check 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.
2020-04-08T13:24:51.3991890Z ========================== Starting Command Output ===========================
2020-04-08T13:24:51.4012440Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/aabd3c70-9592-48eb-946f-5fe304e246bb.sh
2020-04-08T13:24:51.4235736Z 
2020-04-08T13:24:51.4307730Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-08T13:24:51.4324152Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-08T13:24:51.4327268Z Task         : Get sources
2020-04-08T13:24:51.4327534Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-08T13:24:51.4327776Z Version      : 1.0.0
2020-04-08T13:24:51.4327938Z Author       : Microsoft
---
2020-04-08T13:24:52.6091036Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-08T13:24:52.6101968Z ##[command]git config gc.auto 0
2020-04-08T13:24:52.6109444Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-08T13:24:52.6117040Z ##[command]git config --get-all http.proxy
2020-04-08T13:24:52.6129635Z ##[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/70820/merge:refs/remotes/pull/70820/merge
---
2020-04-08T13:27:21.6453734Z  ---> 3fc1b512c57b
2020-04-08T13:27:21.6454097Z Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
2020-04-08T13:27:21.6455140Z  ---> Using cache
2020-04-08T13:27:21.6455731Z  ---> 5ee4295733f4
2020-04-08T13:27:21.6457491Z Step 7/7 : ENV SCRIPT python2.7 ../x.py test src/tools/expand-yaml-anchors &&            python2.7 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python2.7 ../x.py build --stage 0 src/tools/build-manifest &&            python2.7 ../x.py test --stage 0 src/tools/compiletest &&            python2.7 ../x.py test src/tools/tidy &&            /scripts/validate-toolstate.sh
2020-04-08T13:27:21.6459470Z  ---> 3d07a0fa42fe
2020-04-08T13:27:21.6459772Z Successfully built 3d07a0fa42fe
2020-04-08T13:27:21.6460286Z Successfully tagged rust-ci:latest
2020-04-08T13:27:21.6466009Z Built container sha256:3d07a0fa42feb5754fc13bb2f7010ebe13e4b8b8cdbebed0c75d8da320c8c8ad
2020-04-08T13:27:21.6466009Z Built container sha256:3d07a0fa42feb5754fc13bb2f7010ebe13e4b8b8cdbebed0c75d8da320c8c8ad
2020-04-08T13:27:21.6467167Z Looks like docker image is the same as before, not uploading
2020-04-08T13:27:29.7377498Z [CI_JOB_NAME=mingw-check]
2020-04-08T13:27:29.7650212Z [CI_JOB_NAME=mingw-check]
2020-04-08T13:27:29.7680236Z == clock drift check ==
2020-04-08T13:27:29.7690555Z   local time: Wed Apr  8 13:27:29 UTC 2020
2020-04-08T13:27:30.0596409Z   network time: Wed, 08 Apr 2020 13:27:30 GMT
2020-04-08T13:27:30.0621807Z Starting sccache server...
2020-04-08T13:27:30.1548857Z configure: processing command line
2020-04-08T13:27:30.1550290Z configure: 
2020-04-08T13:27:30.1551644Z configure: rust.parallel-compiler := True
---
2020-04-08T13:31:30.6689106Z     Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-08T13:31:30.8641482Z     Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-08T13:31:31.0668708Z     Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-08T13:31:31.1107465Z     Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-08T13:31:31.7288902Z     Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-08T13:31:34.3006950Z     Checking rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-08T13:31:34.8252567Z     Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-08T13:31:37.0839370Z     Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-08T13:31:37.5494330Z     Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-08T13:32:17.2936313Z     Checking rustc_traits v0.0.0 (/checkout/src/librustc_traits)
2020-04-08T13:32:17.4325055Z error: expected identifier, found `&`
2020-04-08T13:32:17.4325809Z   --> src/librustc_mir/transform/uneval_const_set.rs:12:38
2020-04-08T13:32:17.4326348Z    |
2020-04-08T13:32:17.4327063Z 12 |         UnevalConstSetVisitor { tcx, &mut uneval_consts }.visit_body(body);
2020-04-08T13:32:17.4329137Z    |         |
2020-04-08T13:32:17.4329791Z    |         while parsing this struct
2020-04-08T13:32:17.4330074Z 
2020-04-08T13:32:18.5146654Z error: unused import: `self`
2020-04-08T13:32:18.5146654Z error: unused import: `self`
2020-04-08T13:32:18.5147356Z   --> src/librustc_mir/transform/simplify.rs:35:24
2020-04-08T13:32:18.5147898Z    |
2020-04-08T13:32:18.5148524Z 35 | use rustc_middle::ty::{self, TyCtxt};
2020-04-08T13:32:18.5149754Z    |
2020-04-08T13:32:18.5150651Z    = note: `-D unused-imports` implied by `-D warnings`
2020-04-08T13:32:18.5150992Z 
2020-04-08T13:32:21.9350739Z     Checking rustc_plugin_impl v0.0.0 (/checkout/src/librustc_plugin_impl)
2020-04-08T13:32:21.9350739Z     Checking rustc_plugin_impl v0.0.0 (/checkout/src/librustc_plugin_impl)
2020-04-08T13:32:22.1294567Z     Checking rustc_privacy v0.0.0 (/checkout/src/librustc_privacy)
2020-04-08T13:32:25.1815802Z error[E0063]: missing field `uneval_consts` in initializer of `transform::uneval_const_set::UnevalConstSetVisitor<'_, '_>`
2020-04-08T13:32:25.1817257Z   --> src/librustc_mir/transform/uneval_const_set.rs:12:9
2020-04-08T13:32:25.1818506Z    |
2020-04-08T13:32:25.1820550Z 12 |         UnevalConstSetVisitor { tcx, &mut uneval_consts }.visit_body(body);
2020-04-08T13:32:25.1822623Z 
2020-04-08T13:32:25.6863701Z error: aborting due to 3 previous errors
2020-04-08T13:32:25.6864042Z 
2020-04-08T13:32:25.6864614Z For more information about this error, try `rustc --explain E0063`.
2020-04-08T13:32:25.6864614Z For more information about this error, try `rustc --explain E0063`.
2020-04-08T13:32:25.7096669Z error: could not compile `rustc_mir`.
2020-04-08T13:32:25.7097016Z 
2020-04-08T13:32:25.7097465Z To learn more, run the command again with --verbose.
2020-04-08T13:32:25.7123972Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
2020-04-08T13:32:25.7136086Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
2020-04-08T13:32:25.7136458Z Build completed unsuccessfully in 0:04:55
2020-04-08T13:32:25.7196305Z == clock drift check ==
2020-04-08T13:32:25.7210197Z   local time: Wed Apr  8 13:32:25 UTC 2020
2020-04-08T13:32:25.7210197Z   local time: Wed Apr  8 13:32:25 UTC 2020
2020-04-08T13:32:26.0113409Z   network time: Wed, 08 Apr 2020 13:32:26 GMT
2020-04-08T13:32:26.7178960Z 
2020-04-08T13:32:26.7178960Z 
2020-04-08T13:32:26.7264767Z ##[error]Bash exited with code '1'.
2020-04-08T13:32:26.7279254Z ##[section]Finishing: Run build
2020-04-08T13:32:26.7406518Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-08T13:32:26.7412229Z Task         : Get sources
2020-04-08T13:32:26.7413672Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-08T13:32:26.7414040Z Version      : 1.0.0
2020-04-08T13:32:26.7414288Z Author       : Microsoft
2020-04-08T13:32:26.7414288Z Author       : Microsoft
2020-04-08T13:32:26.7414657Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-08T13:32:26.7415303Z ==============================================================================
2020-04-08T13:32:27.1002437Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-08T13:32:27.1050219Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70820/merge to s
2020-04-08T13:32:27.1152606Z Cleaning up task key
2020-04-08T13:32:27.1154232Z Start cleaning up orphan processes.
2020-04-08T13:32:27.1368860Z Terminate orphan process: pid (3461) (python)
2020-04-08T13:32:27.1650643Z ##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Apr 16, 2020

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

@spastorino spastorino force-pushed the replace-fragile-erroneous-const-sys branch from ca9a5fd to 19262f0 Compare April 17, 2020 18:01
@spastorino spastorino marked this pull request as ready for review April 17, 2020 18:02
@spastorino spastorino force-pushed the replace-fragile-erroneous-const-sys branch 6 times, most recently from 2fb6333 to d90c341 Compare April 17, 2020 19:51
@spastorino
Copy link
Member Author

Once working and accepted this should not be rolled up.

@bors rollup=never

@wesleywiser
Copy link
Member

Let's do a perf run just to make sure this doesn't have any negative effects (and hopefully some positive ones).

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Apr 17, 2020

⌛ Trying commit d90c3418677a4cc4a36038700f6ef3e7fe37cb01 with merge b8d790ba8c6168fc4039fb772e27c8274a25f61c...

@bors
Copy link
Contributor

bors commented Apr 23, 2020

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

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 23, 2020
@spastorino spastorino force-pushed the replace-fragile-erroneous-const-sys branch from 543d514 to 7bc45f6 Compare April 23, 2020 21:08
@spastorino
Copy link
Member Author

Rebased again.

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Apr 23, 2020

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

bors commented Apr 24, 2020

⌛ Testing commit 7bc45f6 with merge 0b95879...

@bors
Copy link
Contributor

bors commented Apr 24, 2020

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

@nnethercote
Copy link
Contributor

This was a major perf win for ctfe-stress-4, both for wall time (best of -34%) and even more for max-rss (best of -69%)

@RalfJung
Copy link
Member

Interesting. @oli-obk @spastorino Is that expected or does this indicate we are failing to do some work now that we should be doing?

@oli-obk
Copy link
Contributor

oli-obk commented May 20, 2020

That's very curious. I wouldn't have thought this to have any impact on perf. We're not doing the optimizations yet that would have a positive perf impact, so idk what's going on here. I'm doing another review round now with this in mind

@oli-obk
Copy link
Contributor

oli-obk commented May 20, 2020

Ok so I thought what's happening:

  1. All assignments of () type get removed from MIR
  2. The inliner eagerly evaluates all constants while inlining
  3. These eagerly evaluated constants don't cause more calls to the const_eval query.

But then I wondered how this would reduce just the time const_eval_raw takes, instead of the number of times it is executed. Then I remembered that there are many many const fn in those stress tests. So what we've managed to do is reduce the amount of work done by CTFE when evaluating a constant that calls a const fn that has loads of variables of () type that are assigned from constants.

Looking at https://github.com/rust-lang/rustc-perf/blob/master/collector/benchmarks/ctfe-stress-4/src/lib.rs I believe this is a resonable explanation.

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.

Replace our fragile safety scheme around erroneous constants
10 participants