rust
rust copied to clipboard
Stop using `Reveal::All` before borrowck
Using Reveal::All before borrowck is incorrect, both because that means that we peek into opaque types at a point which is still observable by the user, and more importantly, because peaking into opaque types causes query cycles if it happens this early.
I completely remove param_env.with_reveal_all_normalized. This function changes the context of a param env from "I am used for userfacing stuff" to "nm, actually I am not", which should always be incorrect or at least dubious enough to require an explicit impl with its own comment.
This is a breaking change in a few subtle ways, so it definitely needs a crater run. Still have to add some more tests where this is impactful.
r? @rust-lang/types @rust-lang/wg-const-eval
Some changes occurred to MIR optimizations
cc @rust-lang/wg-mir-opt
Some changes occurred to the CTFE / Miri engine
cc @rust-lang/miri
@bors try
:hourglass: Trying commit 734d9d31e25b96364615dafc244a848c7f2e4488 with merge 9b4fd9cf46c3c08bce1c5ed60b929af1c4aaed01...
The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Check compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
running 185 tests
.......................................i................................................ 88/185
........Fi.........F..................................ii.......i........................ 176/185
Some tests failed in compiletest suite=mir-opt mode=mir-opt host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
failures:
---- [mir-opt] src/test/mir-opt/inline/inline-generator.rs stdout ----
---- [mir-opt] src/test/mir-opt/inline/inline-generator.rs stdout ----
50 + Deinit(_4); // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
51 + discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
52 _3 = &mut _4; // scope 0 at $DIR/inline-generator.rs:+1:23: +1:31
- - _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:32
+ - _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new(move _3) -> [return: bb2, unwind: bb7]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:32
54 - // mir::Constant
55 - // + span: $DIR/inline-generator.rs:9:14: 9:22
56 - // + user_ty: UserType(0)
67 + StorageDead(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
68 + StorageDead(_5); // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL
69 StorageDead(_3); // scope 0 at $DIR/inline-generator.rs:+1:31: +1:32
- - _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ - _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb7]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
71 - // mir::Constant
72 - // + span: $DIR/inline-generator.rs:9:33: 9:39
73 - // + literal: Const { ty: for<'r> fn(Pin<&'r mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume}, val: Value(<ZST>) }
77 + StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
78 + _13 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
79 + _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
- + switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ + switchInt(move _12) -> [0_u32: bb7, 1_u32: bb12, 3_u32: bb11, otherwise: bb13]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
82
83 - bb3: {
86 + StorageDead(_10); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
87 + StorageDead(_7); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
88 StorageDead(_2); // scope 0 at $DIR/inline-generator.rs:+1:45: +1:46
+ - drop(_4) -> [return: bb4, unwind: bb6]; // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
+ + drop(_4) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
+
+ - bb4: {
+ + bb2: {
+ + bb2: {
89 StorageDead(_4); // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
90 _0 = const (); // scope 0 at $DIR/inline-generator.rs:+0:11: +2:2
+ - drop(_1) -> [return: bb5, unwind: bb8]; // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
+ + drop(_1) -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
+
+ - bb5: {
+ + bb3: {
+ + bb3: {
91 StorageDead(_1); // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
92 return; // scope 0 at $DIR/inline-generator.rs:+2:2: +2:2
94
94
- - bb4 (cleanup): {
- + bb2 (cleanup): {
+ - bb6 (cleanup): {
+ - drop(_1) -> bb8; // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
+ + bb4 (cleanup): {
+ + drop(_1) -> bb6; // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
+
+
+ - bb7 (cleanup): {
+ - drop(_4) -> bb8; // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
+ + bb5 (cleanup): {
+ + drop(_4) -> bb6; // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
+
+
+ - bb8 (cleanup): {
+ + bb6 (cleanup): {
97 resume; // scope 0 at $DIR/inline-generator.rs:+0:1: +2:2
99 +
- + bb3: {
+ + bb7: {
+ + bb7: {
101 + _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
102 + StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
103 + StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
104 + _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
- + switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
+ + switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
107 +
- + bb4: {
+ + bb8: {
+ + bb8: {
109 + _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:15:24: 15:25
- + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ + goto -> bb10; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
112 +
- + bb5: {
+ + bb9: {
+ + bb9: {
114 + _8 = const 13_i32; // scope 6 at $DIR/inline-generator.rs:15:35: 15:37
- + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ + goto -> bb10; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
117 +
- + bb6: {
+ + bb10: {
+ + bb10: {
119 + StorageDead(_9); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
120 + Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
121 + ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
125 + goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:11: 15:39
127 +
- + bb7: {
+ + bb11: {
+ + bb11: {
129 + StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
130 + _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
131 + StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
137 + goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:8: 15:8
139 +
- + bb8: {
- + bb8: {
- + assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ + bb12: {
+ + assert(const false, "generator resumed after completion") -> [success: bb12, unwind: bb5]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
143 +
- + bb9: {
+ + bb13: {
+ + bb13: {
145 + unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
147 }
thread '[mir-opt] src/test/mir-opt/inline/inline-generator.rs' panicked at 'Actual MIR output differs from expected MIR output /checkout/src/test/mir-opt/inline/inline_generator.main.Inline.diff', src/tools/compiletest/src/runtest.rs:3516:25
---- [mir-opt] src/test/mir-opt/inline/issue-78442.rs stdout ----
---- [mir-opt] src/test/mir-opt/inline/issue-78442.rs stdout ----
15 StorageLive(_2); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
16 StorageLive(_3); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
17 StorageLive(_4); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
- _4 = hide_foo() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
+ _4 = hide_foo() -> [return: bb1, unwind: bb6]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
19 // mir::Constant
20 // + span: $DIR/issue-78442.rs:11:5: 11:13
21 // + literal: Const { ty: fn() -> impl Fn() {hide_foo}, val: Value(<ZST>) }
25 _3 = &_4; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
26 StorageLive(_5); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
27 Deinit(_5); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
- - _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
- + _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
+ - _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
+ + _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
30 // mir::Constant
31 // + span: $DIR/issue-78442.rs:11:5: 11:15
32 - // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
36 bb2: {
36 bb2: {
37 StorageDead(_5); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17
38 StorageDead(_3); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17
+ drop(_4) -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18
+
+ bb3: {
+ bb3: {
39 StorageDead(_4); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18
40 StorageDead(_2); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18
41 _0 = const (); // scope 0 at $DIR/issue-78442.rs:+3:3: +5:2
- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2
+ drop(_1) -> [return: bb4, unwind: bb7]; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2
44
- bb3: {
+ bb4: {
+ bb4: {
46 return; // scope 0 at $DIR/issue-78442.rs:+5:2: +5:2
48
- bb4 (cleanup): {
- drop(_1) -> bb5; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2
+ bb5 (cleanup): {
+ drop(_4) -> bb6; // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18
52
52
- bb5 (cleanup): {
+ bb6 (cleanup): {
+ drop(_1) -> bb7; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2
+
+
+ bb7 (cleanup): {
54 resume; // scope 0 at $DIR/issue-78442.rs:+0:1: +5:2
56 }
thread '[mir-opt] src/test/mir-opt/inline/issue-78442.rs' panicked at 'Actual MIR output differs from expected MIR output /checkout/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff', src/tools/compiletest/src/runtest.rs:3516:25
failures:
[mir-opt] src/test/mir-opt/inline/inline-generator.rs
[mir-opt] src/test/mir-opt/inline/issue-78442.rs
ctfe returing TooGeneric for opaque types in otherwise concrete constants causes ICE rn, have to fix this. changing to draft
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions := True
configure: dist.missing-tools := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure:
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
........................................................................................ 4576/13487
........................................................................................ 4664/13487
........................................................................................ 4752/13487
........................................................................................ 4840/13487
.........F.....FF....................................................................... 4928/13487
........................................................................................ 5104/13487
........................................................................................ 5192/13487
............i....................................................................i...... 5280/13487
........................................................................................ 5368/13487
---
....iii................................................................................. 13464/13487
.......................
failures:
---- [ui] src/test/ui/impl-trait/in-ctfe/match-arm-exhaustive.rs stdout ----
1 error: constant pattern depends on a generic parameter
- --> $DIR/match-arm-exhaustive.rs:19:9
+ --> $DIR/match-arm-exhaustive.rs:22:9
+ --> $DIR/match-arm-exhaustive.rs:22:9
3 |
4 LL | CT => (),
6
7 error: constant pattern depends on a generic parameter
- --> $DIR/match-arm-exhaustive.rs:19:9
- --> $DIR/match-arm-exhaustive.rs:19:9
+ --> $DIR/match-arm-exhaustive.rs:22:9
9 |
10 LL | CT => (),
The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/in-ctfe/match-arm-exhaustive/match-arm-exhaustive.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args impl-trait/in-ctfe/match-arm-exhaustive.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/impl-trait/in-ctfe/match-arm-exhaustive.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/in-ctfe/match-arm-exhaustive" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/in-ctfe/match-arm-exhaustive/auxiliary"
stdout: none
--- stderr -------------------------------
error: constant pattern depends on a generic parameter
--> /checkout/src/test/ui/impl-trait/in-ctfe/match-arm-exhaustive.rs:22:9
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
LL | CT => (),
error: constant pattern depends on a generic parameter
error: constant pattern depends on a generic parameter
--> /checkout/src/test/ui/impl-trait/in-ctfe/match-arm-exhaustive.rs:22:9
|
LL | CT => (),
error: aborting due to 2 previous errors
------------------------------------------
---- [ui] src/test/ui/impl-trait/in-ctfe/array-len.rs stdout ----
error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/in-ctfe/array-len" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/in-ctfe/array-len/auxiliary"
stdout: none
--- stderr -------------------------------
error: internal compiler error: no errors encountered even though `delay_span_bug` issued
error: internal compiler error: Missing value for constant, but no error reported?
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:21:19
|
|
LL | let x = [0u8; output(yeet())];
|
= note: delayed at compiler/rustc_trait_selection/src/traits/const_evaluatable.rs:243:43
error: internal compiler error: `InferCtxt` incorrectly tainted by errors
= note: delayed at compiler/rustc_infer/src/infer/mod.rs:1265:27
error: internal compiler error: `ErrorGuaranteed` without an error
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:21:19
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:21:19
|
LL | let x = [0u8; output(yeet())];
|
= note: delayed at compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:1070:31
error: internal compiler error: expected fullfillment errors
= note: delayed at compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:210:23
error: internal compiler error: Missing value for constant, but no error reported?
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:22:22
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:22:22
|
LL | println!("{:?}", x);
| ^
|
= note: delayed at compiler/rustc_trait_selection/src/traits/const_evaluatable.rs:243:43
= note: this error: internal compiler error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: internal compiler error: `InferCtxt` incorrectly tainted by errors
= note: delayed at compiler/rustc_infer/src/infer/mod.rs:1265:27
error: internal compiler error: `ErrorGuaranteed` without an error
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:22:22
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:22:22
|
LL | println!("{:?}", x);
| ^
|
= note: delayed at compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:1070:31
= note: this error: internal compiler error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: internal compiler error: expected fullfillment errors
= note: delayed at compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:210:23
error: internal compiler error: TyKind::Error constructed but no error reported
|
|
= note: delayed at compiler/rustc_mir_build/src/build/mod.rs:759:18
error: internal compiler error: PromoteTemps: MIR had errors
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:20:1
LL | fn main() {
| ^^^^^^^^^
|
= note: delayed at compiler/rustc_const_eval/src/transform/promote_consts.rs:52:22
= note: delayed at compiler/rustc_const_eval/src/transform/promote_consts.rs:52:22
error: internal compiler error: `InferCtxt` incorrectly tainted by errors
= note: delayed at compiler/rustc_infer/src/infer/mod.rs:1265:27
error: internal compiler error: broken MIR in DefId(0:11 ~ array_len[fba9]::main) ("return type"): bad type [type error]
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:20:1
LL | fn main() {
| ^^^^^^^^^
|
= note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:510:13
= note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:510:13
error: internal compiler error: TyKind::Error constructed but no error reported
|
= note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:765:20
error: internal compiler error: broken MIR in DefId(0:11 ~ array_len[fba9]::main) (LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: [type error], user_ty: None, source_info: SourceInfo { span: /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:20:1: 20:10 (#0), scope: scope[0] } }): bad type [type error]
--> /checkout/src/test/ui/impl-trait/in-ctfe/array-len.rs:20:1
LL | fn main() {
| ^^^^^^^^^
|
= note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:510:13
---
= note: delayed at /checkout/compiler/rustc_middle/src/ty/relate.rs:419:59
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1499:13
stack backtrace:
0: 0x7f0221a2011c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6154f49ec1b68f6b
1: 0x7f0221a88cb8 - core::fmt::write::hd9d0343f2cbedb92
2: 0x7f0221a10951 - std::io::Write::write_fmt::ha549726333f8cdaa
3: 0x7f0221a230de - std::panicking::default_hook::{{closure}}::h78e4bb572adc4835
4: 0x7f0221a22da7 - std::panicking::default_hook::h5295d9fa0bc037a5
5: 0x7f02223dee54 - rustc_driver[7035da461767e574]::DEFAULT_HOOK::{closure#0}::{closure#0}
6: 0x7f0221a23891 - std::panicking::rust_panic_with_hook::hf7adfa238344656d
7: 0x7f0225195be3 - std[f51aded392cf5807]::panicking::begin_panic::<rustc_errors[1dc65aa609ac1cb7]::ExplicitBug>::{closure#0}
8: 0x7f02251950e6 - std[f51aded392cf5807]::sys_common::backtrace::__rust_end_short_backtrace::<std[f51aded392cf5807]::panicking::begin_panic<rustc_errors[1dc65aa609ac1cb7]::ExplicitBug>::{closure#0}, !>
9: 0x7f02223a15e6 - std[f51aded392cf5807]::panicking::begin_panic::<rustc_errors[1dc65aa609ac1cb7]::ExplicitBug>
10: 0x7f022519ae46 - std[f51aded392cf5807]::panic::panic_any::<rustc_errors[1dc65aa609ac1cb7]::ExplicitBug>
11: 0x7f022519f3e0 - <rustc_errors[1dc65aa609ac1cb7]::HandlerInner as core[a0f03c9e75f2c779]::ops::drop::Drop>::drop
12: 0x7f0222446d32 - core[a0f03c9e75f2c779]::ptr::drop_in_place::<rustc_session[d72b8f68b509f015]::parse::ParseSess>
13: 0x7f022244c918 - <alloc[71ea6792478043c]::rc::Rc<rustc_session[d72b8f68b509f015]::session::Session> as core[a0f03c9e75f2c779]::ops::drop::Drop>::drop
14: 0x7f02223f3b2c - core[a0f03c9e75f2c779]::ptr::drop_in_place::<rustc_interface[6c04d4d1816d4b85]::interface::Compiler>
15: 0x7f02223e3300 - rustc_interface[6c04d4d1816d4b85]::interface::create_compiler_and_run::<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>
16: 0x7f02223ca3c2 - <scoped_tls[500cab81e62bc929]::ScopedKey<rustc_span[14cd8c142c96546d]::SessionGlobals>>::set::<rustc_interface[6c04d4d1816d4b85]::interface::run_compiler<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>
17: 0x7f02224482bf - std[f51aded392cf5807]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6c04d4d1816d4b85]::util::run_in_thread_pool_with_globals<rustc_interface[6c04d4d1816d4b85]::interface::run_compiler<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>
18: 0x7f02223f76ee - std[f51aded392cf5807]::panic::catch_unwind::<core[a0f03c9e75f2c779]::panic::unwind_safe::AssertUnwindSafe<<std[f51aded392cf5807]::thread::Builder>::spawn_unchecked_<rustc_interface[6c04d4d1816d4b85]::util::run_in_thread_pool_with_globals<rustc_interface[6c04d4d1816d4b85]::interface::run_compiler<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#1}::{closure#0}>, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>
19: 0x7f0222449ae0 - <<std[f51aded392cf5807]::thread::Builder>::spawn_unchecked_<rustc_interface[6c04d4d1816d4b85]::util::run_in_thread_pool_with_globals<rustc_interface[6c04d4d1816d4b85]::interface::run_compiler<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#1} as core[a0f03c9e75f2c779]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
20: 0x7f0221a30635 - std::sys::unix::thread::Thread::new::thread_start::hcc798bf10a89dcd5
21: 0x7f02217cdb43 - <unknown>
22: 0x7f022185fa00 - <unknown>
23: 0x0 - <unknown>
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.65.0-nightly (e7ebcbc2e 2022-09-06) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z threads=1 -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
end of query stack
------------------------------------------
---- [ui] src/test/ui/impl-trait/in-ctfe/enum-discr.rs stdout ----
error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/impl-trait/in-ctfe/enum-discr.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/in-ctfe/enum-discr" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/in-ctfe/enum-discr/auxiliary"
stdout: none
--- stderr -------------------------------
error: internal compiler error: no errors encountered even though `delay_span_bug` issued
error: internal compiler error: Missing value for constant, but no error reported?
--> /checkout/src/test/ui/impl-trait/in-ctfe/enum-discr.rs:22:11
|
|
LL | Bar = output(yeet()),
|
= note: delayed at compiler/rustc_trait_selection/src/traits/const_evaluatable.rs:243:43
error: internal compiler error: `InferCtxt` incorrectly tainted by errors
= note: delayed at compiler/rustc_infer/src/infer/mod.rs:1265:27
error: internal compiler error: `ErrorGuaranteed` without an error
--> /checkout/src/test/ui/impl-trait/in-ctfe/enum-discr.rs:22:11
--> /checkout/src/test/ui/impl-trait/in-ctfe/enum-discr.rs:22:11
|
LL | Bar = output(yeet()),
|
= note: delayed at compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:1070:31
error: internal compiler error: expected fullfillment errors
= note: delayed at compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:210:23
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1499:13
stack backtrace:
stack backtrace:
0: 0x7f60c4c3311c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6154f49ec1b68f6b
1: 0x7f60c4c9bcb8 - core::fmt::write::hd9d0343f2cbedb92
2: 0x7f60c4c23951 - std::io::Write::write_fmt::ha549726333f8cdaa
3: 0x7f60c4c360de - std::panicking::default_hook::{{closure}}::h78e4bb572adc4835
4: 0x7f60c4c35da7 - std::panicking::default_hook::h5295d9fa0bc037a5
5: 0x7f60c55f1e54 - rustc_driver[7035da461767e574]::DEFAULT_HOOK::{closure#0}::{closure#0}
6: 0x7f60c4c36891 - std::panicking::rust_panic_with_hook::hf7adfa238344656d
7: 0x7f60c83a8be3 - std[f51aded392cf5807]::panicking::begin_panic::<rustc_errors[1dc65aa609ac1cb7]::ExplicitBug>::{closure#0}
8: 0x7f60c83a80e6 - std[f51aded392cf5807]::sys_common::backtrace::__rust_end_short_backtrace::<std[f51aded392cf5807]::panicking::begin_panic<rustc_errors[1dc65aa609ac1cb7]::ExplicitBug>::{closure#0}, !>
9: 0x7f60c55b45e6 - std[f51aded392cf5807]::panicking::begin_panic::<rustc_errors[1dc65aa609ac1cb7]::ExplicitBug>
10: 0x7f60c83ade46 - std[f51aded392cf5807]::panic::panic_any::<rustc_errors[1dc65aa609ac1cb7]::ExplicitBug>
11: 0x7f60c83b23e0 - <rustc_errors[1dc65aa609ac1cb7]::HandlerInner as core[a0f03c9e75f2c779]::ops::drop::Drop>::drop
12: 0x7f60c5659d32 - core[a0f03c9e75f2c779]::ptr::drop_in_place::<rustc_session[d72b8f68b509f015]::parse::ParseSess>
13: 0x7f60c565f918 - <alloc[71ea6792478043c]::rc::Rc<rustc_session[d72b8f68b509f015]::session::Session> as core[a0f03c9e75f2c779]::ops::drop::Drop>::drop
14: 0x7f60c5606b2c - core[a0f03c9e75f2c779]::ptr::drop_in_place::<rustc_interface[6c04d4d1816d4b85]::interface::Compiler>
15: 0x7f60c55f6300 - rustc_interface[6c04d4d1816d4b85]::interface::create_compiler_and_run::<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>
16: 0x7f60c55dd3c2 - <scoped_tls[500cab81e62bc929]::ScopedKey<rustc_span[14cd8c142c96546d]::SessionGlobals>>::set::<rustc_interface[6c04d4d1816d4b85]::interface::run_compiler<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>
17: 0x7f60c565b2bf - std[f51aded392cf5807]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6c04d4d1816d4b85]::util::run_in_thread_pool_with_globals<rustc_interface[6c04d4d1816d4b85]::interface::run_compiler<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>
18: 0x7f60c560a6ee - std[f51aded392cf5807]::panic::catch_unwind::<core[a0f03c9e75f2c779]::panic::unwind_safe::AssertUnwindSafe<<std[f51aded392cf5807]::thread::Builder>::spawn_unchecked_<rustc_interface[6c04d4d1816d4b85]::util::run_in_thread_pool_with_globals<rustc_interface[6c04d4d1816d4b85]::interface::run_compiler<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#1}::{closure#0}>, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>
19: 0x7f60c565cae0 - <<std[f51aded392cf5807]::thread::Builder>::spawn_unchecked_<rustc_interface[6c04d4d1816d4b85]::util::run_in_thread_pool_with_globals<rustc_interface[6c04d4d1816d4b85]::interface::run_compiler<core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>, rustc_driver[7035da461767e574]::run_compiler::{closure#1}>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#0}, core[a0f03c9e75f2c779]::result::Result<(), rustc_errors[1dc65aa609ac1cb7]::ErrorGuaranteed>>::{closure#1} as core[a0f03c9e75f2c779]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
20: 0x7f60c4c43635 - std::sys::unix::thread::Thread::new::thread_start::hcc798bf10a89dcd5
21: 0x7f60c49e0b43 - <unknown>
22: 0x7f60c4a72a00 - <unknown>
23: 0x0 - <unknown>
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.65.0-nightly (e7ebcbc2e 2022-09-06) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z threads=1 -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
end of query stack
------------------------------------------
failures:
[ui] src/test/ui/impl-trait/in-ctfe/array-len.rs
[ui] src/test/ui/impl-trait/in-ctfe/enum-discr.rs
[ui] src/test/ui/impl-trait/in-ctfe/match-arm-exhaustive.rs
test result: FAILED. 13366 passed; 3 failed; 118 ignored; 0 measured; 0 filtered out; finished in 130.23s
Build completed unsuccessfully in 0:12:57
The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Check compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
running 185 tests
.......................................i................................................ 88/185
.........i..F....F....................................ii.......i........................ 176/185
Some tests failed in compiletest suite=mir-opt mode=mir-opt host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
failures:
---- [mir-opt] src/test/mir-opt/inline/inline-generator.rs stdout ----
---- [mir-opt] src/test/mir-opt/inline/inline-generator.rs stdout ----
50 + Deinit(_4); // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
51 + discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
52 _3 = &mut _4; // scope 0 at $DIR/inline-generator.rs:+1:23: +1:31
- - _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:32
+ - _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new(move _3) -> [return: bb2, unwind: bb7]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:32
54 - // mir::Constant
55 - // + span: $DIR/inline-generator.rs:9:14: 9:22
56 - // + user_ty: UserType(0)
67 + StorageDead(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
68 + StorageDead(_5); // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL
69 StorageDead(_3); // scope 0 at $DIR/inline-generator.rs:+1:31: +1:32
- - _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ - _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb7]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
71 - // mir::Constant
72 - // + span: $DIR/inline-generator.rs:9:33: 9:39
73 - // + literal: Const { ty: for<'r> fn(Pin<&'r mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume}, val: Value(<ZST>) }
77 + StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
78 + _13 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
79 + _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
- + switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ + switchInt(move _12) -> [0_u32: bb7, 1_u32: bb12, 3_u32: bb11, otherwise: bb13]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
82
83 - bb3: {
86 + StorageDead(_10); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
87 + StorageDead(_7); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
88 StorageDead(_2); // scope 0 at $DIR/inline-generator.rs:+1:45: +1:46
+ - drop(_4) -> [return: bb4, unwind: bb6]; // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
+ + drop(_4) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
+
+ - bb4: {
+ + bb2: {
+ + bb2: {
89 StorageDead(_4); // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
90 _0 = const (); // scope 0 at $DIR/inline-generator.rs:+0:11: +2:2
+ - drop(_1) -> [return: bb5, unwind: bb8]; // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
+ + drop(_1) -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
+
+ - bb5: {
+ + bb3: {
+ + bb3: {
91 StorageDead(_1); // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
92 return; // scope 0 at $DIR/inline-generator.rs:+2:2: +2:2
94
94
- - bb4 (cleanup): {
- + bb2 (cleanup): {
+ - bb6 (cleanup): {
+ - drop(_1) -> bb8; // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
+ + bb4 (cleanup): {
+ + drop(_1) -> bb6; // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2
+
+
+ - bb7 (cleanup): {
+ - drop(_4) -> bb8; // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
+ + bb5 (cleanup): {
+ + drop(_4) -> bb6; // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47
+
+
+ - bb8 (cleanup): {
+ + bb6 (cleanup): {
97 resume; // scope 0 at $DIR/inline-generator.rs:+0:1: +2:2
99 +
- + bb3: {
+ + bb7: {
+ + bb7: {
101 + _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
102 + StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
103 + StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
104 + _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
- + switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
+ + switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
107 +
- + bb4: {
+ + bb8: {
+ + bb8: {
109 + _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:15:24: 15:25
- + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ + goto -> bb10; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
112 +
- + bb5: {
+ + bb9: {
+ + bb9: {
114 + _8 = const 13_i32; // scope 6 at $DIR/inline-generator.rs:15:35: 15:37
- + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ + goto -> bb10; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
117 +
- + bb6: {
+ + bb10: {
+ + bb10: {
119 + StorageDead(_9); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
120 + Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
121 + ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
125 + goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:11: 15:39
127 +
- + bb7: {
+ + bb11: {
+ + bb11: {
129 + StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
130 + _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
131 + StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
137 + goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:8: 15:8
139 +
- + bb8: {
- + bb8: {
- + assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ + bb12: {
+ + assert(const false, "generator resumed after completion") -> [success: bb12, unwind: bb5]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
143 +
- + bb9: {
+ + bb13: {
+ + bb13: {
145 + unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
147 }
thread '[mir-opt] src/test/mir-opt/inline/inline-generator.rs' panicked at 'Actual MIR output differs from expected MIR output /checkout/src/test/mir-opt/inline/inline_generator.main.Inline.diff', src/tools/compiletest/src/runtest.rs:3516:25
---- [mir-opt] src/test/mir-opt/inline/issue-78442.rs stdout ----
---- [mir-opt] src/test/mir-opt/inline/issue-78442.rs stdout ----
15 StorageLive(_2); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
16 StorageLive(_3); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
17 StorageLive(_4); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
- _4 = hide_foo() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
+ _4 = hide_foo() -> [return: bb1, unwind: bb6]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
19 // mir::Constant
20 // + span: $DIR/issue-78442.rs:11:5: 11:13
21 // + literal: Const { ty: fn() -> impl Fn() {hide_foo}, val: Value(<ZST>) }
25 _3 = &_4; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15
26 StorageLive(_5); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
27 Deinit(_5); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
- - _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
- + _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
+ - _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
+ + _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
30 // mir::Constant
31 // + span: $DIR/issue-78442.rs:11:5: 11:15
32 - // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
36 bb2: {
36 bb2: {
37 StorageDead(_5); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17
38 StorageDead(_3); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17
+ drop(_4) -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18
+
+ bb3: {
+ bb3: {
39 StorageDead(_4); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18
40 StorageDead(_2); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18
41 _0 = const (); // scope 0 at $DIR/issue-78442.rs:+3:3: +5:2
- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2
+ drop(_1) -> [return: bb4, unwind: bb7]; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2
44
- bb3: {
+ bb4: {
+ bb4: {
46 return; // scope 0 at $DIR/issue-78442.rs:+5:2: +5:2
48
- bb4 (cleanup): {
- drop(_1) -> bb5; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2
+ bb5 (cleanup): {
+ drop(_4) -> bb6; // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18
52
52
- bb5 (cleanup): {
+ bb6 (cleanup): {
+ drop(_1) -> bb7; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2
+
+
+ bb7 (cleanup): {
54 resume; // scope 0 at $DIR/issue-78442.rs:+0:1: +5:2
56 }
thread '[mir-opt] src/test/mir-opt/inline/issue-78442.rs' panicked at 'Actual MIR output differs from expected MIR output /checkout/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff', src/tools/compiletest/src/runtest.rs:3516:25
failures:
[mir-opt] src/test/mir-opt/inline/inline-generator.rs
[mir-opt] src/test/mir-opt/inline/issue-78442.rs
@bors try @rust-timer queue
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
:hourglass: Trying commit 41066e292b5aa36b4ba157f9ef838cda7ad6f68b with merge 0004f98fdd309b1940390200ae28913f7fbd736f...
:sunny: Try build successful - checks-actions
Build commit: 0004f98fdd309b1940390200ae28913f7fbd736f (0004f98fdd309b1940390200ae28913f7fbd736f)
Queued 0004f98fdd309b1940390200ae28913f7fbd736f with parent 0568b0a3de4eb37bf187eb61a9f017ae0018ad8f, future comparison URL.
Some changes occurred to the CTFE / Miri engine
cc @rust-lang/miri
@craterbot check
:ok_hand: Experiment pr-101478 created and queued.
:robot: Automatically detected try build 0004f98fdd309b1940390200ae28913f7fbd736f
:mag: You can check out the queue and this experiment's details.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:construction: Experiment pr-101478 is now running
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
Finished benchmarking commit (0004f98fdd309b1940390200ae28913f7fbd736f): comparison URL.
Overall result: ❌✅ regressions and improvements - ACTION NEEDED
Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.
Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.
@bors rollup=never @rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression
Instruction count
This is a highly reliable metric that was used to determine the overall result at the top of this comment.
| mean[^1] | range | count[^2] | |
|---|---|---|---|
| Regressions ❌ (primary) |
0.4% | [0.2%, 0.8%] | 8 |
| Regressions ❌ (secondary) |
2.5% | [0.8%, 9.1%] | 11 |
| Improvements ✅ (primary) |
-0.6% | [-0.8%, -0.5%] | 5 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | -0.0% | [-0.8%, 0.8%] | 13 |
Max RSS (memory usage)
This benchmark run did not return any relevant results for this metric.
Cycles
Results
This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
| mean[^1] | range | count[^2] | |
|---|---|---|---|
| Regressions ❌ (primary) |
3.9% | [3.9%, 3.9%] | 1 |
| Regressions ❌ (secondary) |
7.5% | [6.3%, 8.3%] | 3 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-3.0% | [-3.0%, -3.0%] | 1 |
| All ❌✅ (primary) | 3.9% | [3.9%, 3.9%] | 1 |
[^1]: the arithmetic mean of the percent change [^2]: number of relevant changes
Re-rolling
r? @rust-lang/types
r? @oli-obk
:tada: Experiment pr-101478 is completed!
:bar_chart: 68 regressed and 7 fixed (242878 total)
:newspaper: Open the full report.
:warning: If you notice any spurious failure please add them to the blacklist! :information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
it looks like we have 2 true regressions:
- name-it-0.1.3
- mijit-0.1.8
both have fewer than 100 total downloads. Haven't looked at name-it yet but mijit is probably pretty easy to fix. It looks like opaque types during ctfe really aren't used that much (luckily).
will go and write an fcp to merge this, probably needs t-lang and t-types? idk
I think this is again completely in T-types territory, but maybe we should make it both teams this time to ask T-lang if they also think that ^^
Also it's a breaking change to stable code so probably better to include T-lang.
I think this is pretty firmly T-types (we do have authority to decide on breaking changes related to types/traits/borrowck), but it doesn't hurt to loop in T-lang. Better to error on the side of "caution".
This pull request changes the compiler to stop using Reveal::All at any point until borrowck is completed. Using Reveal::All means that it is possible to inspect
- the underlying type of opaque types
- the value of a "defaulted" associated item (requires
feature(specialization))
This breaks existing stable code
This mostly impacts const evaluation in the type system, i.e. const generics. We stop leaking the type of opaque types, making them pretty much unusable in constants in the type system. For examples, see the added tests in ui/impl-trait/in-ctfe.
This is desirable as observing the concrete type of opaque types should not be possible during typeck, and more importantly, trying to reveal the concrete type can cause cycles, as seen in ui/type-alias-impl-trait/in-where-clauses.rs. Even worse, current work on implied bounds will move implied bounds into the param_env, making them less special and unblocking future work. With this work, fn foo<'a>() -> &'a impl Send adds the implied bound impl Send: 'a to foo, causing a cycle if ctfe is used while type-checking foo.
It also changes transmute checking to not use Reveal::All. While we could move transmute checking out of the typeck query, using Reveal::All also feels wrong here. See ui/impl-trait/transmute for this. Keeping Reveal::All for transmute checking may also make it harder to properly integrate the size check in the type system in the future.
A crater run found 2 regressions:
mijit
Transmute in a test between an opaque type and the underlying concrete type. Opened PR fixing this in https://github.com/apt1002/mijit/pull/51.
name-it
This crate cannot really be fixed, as it fundamentally requires this pattern:
use std::mem;
fn returns_opaque() -> impl Sized {
0u8
}
struct NamedOpaqueType {
data: [mem::MaybeUninit<u8>; size_of_fut(returns_opaque)]
}
const fn size_of_fut<FUT>(x: fn() -> FUT) -> usize {
mem::size_of::<FUT>()
}
For this to work, we would be required to add the notion of "opaque values" to CTFE. I don't know how complex of a change this would be, but expect it to not be trivial. While really unfortunate, I propose to accept the breakage of this crate. Hopefully the crate will be fully obsolete due to stable TAIT in the near future.
@rfcbot fcp merge
Team member @lcnr has proposed to merge this. The next step is review by the rest of the tagged team members:
- [x] @compiler-errors
- [ ] @cramertj
- [ ] @jackh726
- [ ] @joshtriplett
- [x] @lcnr
- [ ] @nikomatsakis
- [x] @oli-obk
- [ ] @pnkfelix
- [ ] @scottmcm
- [x] @spastorino
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
@oli-obk suggested that we may keep name-it working by special-casing stuff like size_of.
That should avoid the unintentional cycles and generally seems fine, as we already allow the return value of size_of to change. Not completely happy, but whatever :shrug:
nominating for t-types discussion
+1 for an exemption for size_of/align_of. I think, though, that those two are specific cases of a more general pattern. When using impl Trait, common goals are either (1) to limit the visibility of the underlying type to just Trait and/or (2) to talk about an unnameable type.
In line with (1), I can imagine that users might want to limit exact knowledge of the type while still revealing compile-time-constant properties such as size, alignment, an associated constant, or a const fn. For example, -> impl const Default would presumably allow default instances of that return type to be created in const contexts.
Can you clarify whether you see the direction of this PR as being at-odds with a long term vision that included these kinds of abilities?
@lcnr can you clarify what the "exemption" would be for size-of exactly?