Skip to content

Commit 6108ac3

Browse files
authored
Unrolled build for rust-lang#121308
Rollup merge of rust-lang#121308 - kadiwa4:test_103369, r=TaKO8Ki Add regression test for rust-lang#103369 The issue was fixed in 1.70.0. Closes rust-lang#103369.
2 parents bcea3cb + 7fd7b47 commit 6108ac3

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// #103369: don't complain about conflicting implementations with [const error]
2+
3+
pub trait ConstGenericTrait<const N: u32> {}
4+
5+
impl ConstGenericTrait<{my_fn(1)}> for () {}
6+
7+
impl ConstGenericTrait<{my_fn(2)}> for () {}
8+
9+
const fn my_fn(v: u32) -> u32 {
10+
panic!("Some error occurred"); //~ ERROR E0080
11+
//~| ERROR E0080
12+
}
13+
14+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
error[E0080]: evaluation of constant value failed
2+
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
3+
|
4+
LL | panic!("Some error occurred");
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Some error occurred', $DIR/const-errs-dont-conflict-103369.rs:10:5
6+
|
7+
note: inside `my_fn`
8+
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
9+
|
10+
LL | panic!("Some error occurred");
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
note: inside `<() as ConstGenericTrait<{my_fn(1)}>>::{constant#0}`
13+
--> $DIR/const-errs-dont-conflict-103369.rs:5:25
14+
|
15+
LL | impl ConstGenericTrait<{my_fn(1)}> for () {}
16+
| ^^^^^^^^
17+
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
18+
19+
error[E0080]: evaluation of constant value failed
20+
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
21+
|
22+
LL | panic!("Some error occurred");
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Some error occurred', $DIR/const-errs-dont-conflict-103369.rs:10:5
24+
|
25+
note: inside `my_fn`
26+
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
27+
|
28+
LL | panic!("Some error occurred");
29+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
note: inside `<() as ConstGenericTrait<{my_fn(2)}>>::{constant#0}`
31+
--> $DIR/const-errs-dont-conflict-103369.rs:7:25
32+
|
33+
LL | impl ConstGenericTrait<{my_fn(2)}> for () {}
34+
| ^^^^^^^^
35+
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
36+
37+
error: aborting due to 2 previous errors
38+
39+
For more information about this error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)