Skip to content

Commit 7af5775

Browse files
committed
Bless collect-in-promoted-const.rs
1 parent afff050 commit 7af5775

File tree

3 files changed

+7
-26
lines changed

3 files changed

+7
-26
lines changed

tests/ui/consts/required-consts/collect-in-promoted-const.noopt.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error[E0080]: evaluation panicked: explicit panic
2-
--> $DIR/collect-in-promoted-const.rs:11:19
2+
--> $DIR/collect-in-promoted-const.rs:9:19
33
|
44
LL | const C: () = panic!();
55
| ^^^^^^^^ evaluation of `Fail::<i32>::C` failed here
66

77
note: erroneous constant encountered
8-
--> $DIR/collect-in-promoted-const.rs:22:21
8+
--> $DIR/collect-in-promoted-const.rs:17:21
99
|
1010
LL | let _val = &Fail::<T>::C;
1111
| ^^^^^^^^^^^^
1212

1313
note: the above error was encountered while instantiating `fn f::<i32>`
14-
--> $DIR/collect-in-promoted-const.rs:27:5
14+
--> $DIR/collect-in-promoted-const.rs:22:5
1515
|
1616
LL | f::<i32>();
1717
| ^^^^^^^^^^
Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,21 @@
11
error[E0080]: evaluation panicked: explicit panic
2-
--> $DIR/collect-in-promoted-const.rs:11:19
3-
|
4-
LL | const C: () = panic!();
5-
| ^^^^^^^^ evaluation of `Fail::<T>::C` failed here
6-
7-
note: erroneous constant encountered
8-
--> $DIR/collect-in-promoted-const.rs:22:21
9-
|
10-
LL | let _val = &Fail::<T>::C;
11-
| ^^^^^^^^^^^^
12-
13-
error[E0080]: evaluation panicked: explicit panic
14-
--> $DIR/collect-in-promoted-const.rs:11:19
2+
--> $DIR/collect-in-promoted-const.rs:9:19
153
|
164
LL | const C: () = panic!();
175
| ^^^^^^^^ evaluation of `Fail::<i32>::C` failed here
186

197
note: erroneous constant encountered
20-
--> $DIR/collect-in-promoted-const.rs:22:21
8+
--> $DIR/collect-in-promoted-const.rs:17:21
219
|
2210
LL | let _val = &Fail::<T>::C;
2311
| ^^^^^^^^^^^^
24-
|
25-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2612

2713
note: the above error was encountered while instantiating `fn f::<i32>`
28-
--> $DIR/collect-in-promoted-const.rs:27:5
14+
--> $DIR/collect-in-promoted-const.rs:22:5
2915
|
3016
LL | f::<i32>();
3117
| ^^^^^^^^^^
3218

33-
error: aborting due to 2 previous errors
19+
error: aborting due to 1 previous error
3420

3521
For more information about this error, try `rustc --explain E0080`.

tests/ui/consts/required-consts/collect-in-promoted-const.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
//@revisions: noopt opt
22
//@ build-fail
33
//@[noopt] compile-flags: -Copt-level=0
4-
// FIXME(#61117): Respect debuginfo-level-tests, do not force debuginfo=0
5-
//@[opt] compile-flags: -C debuginfo=0
64
//@[opt] compile-flags: -O
75
//! Make sure we error on erroneous consts even if they get promoted.
86
97
struct Fail<T>(T);
108
impl<T> Fail<T> {
119
const C: () = panic!(); //~ERROR evaluation panicked: explicit panic
12-
//[opt]~^ ERROR evaluation panicked: explicit panic
13-
// (Not sure why optimizations lead to this being emitted twice, but as long as compilation
14-
// fails either way it's fine.)
1510
}
1611

1712
#[inline(never)]

0 commit comments

Comments
 (0)