File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ //! ICE test #124348
2+ //! We should not be running const eval if the layout has errors.
3+
4+ enum Eek {
5+ TheConst ,
6+ UnusedByTheConst ( Sum ) ,
7+ //~^ ERROR cannot find type `Sum` in this scope
8+ }
9+
10+ const fn foo ( ) {
11+ let x: & ' static [ Eek ] = & [ ] ;
12+ }
13+
14+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0412]: cannot find type `Sum` in this scope
2+ --> $DIR/erroneous_type_in_promoted.rs:6:22
3+ |
4+ LL | UnusedByTheConst(Sum),
5+ | ^^^ not found in this scope
6+ |
7+ help: consider importing this trait
8+ |
9+ LL + use std::iter::Sum;
10+ |
11+
12+ note: erroneous constant encountered
13+ --> $DIR/erroneous_type_in_promoted.rs:11:29
14+ |
15+ LL | let x: &'static [Eek] = &[];
16+ | ^^^
17+
18+ note: erroneous constant encountered
19+ --> $DIR/erroneous_type_in_promoted.rs:11:29
20+ |
21+ LL | let x: &'static [Eek] = &[];
22+ | ^^^
23+ |
24+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
25+
26+ error: aborting due to 1 previous error
27+
28+ For more information about this error, try `rustc --explain E0412`.
You can’t perform that action at this time.
0 commit comments