Skip to content

Commit

Permalink
Unrolled build for rust-lang#121308
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rust-timer authored Feb 20, 2024
2 parents bcea3cb + 7fd7b47 commit 6108ac3
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/ui/coherence/const-errs-dont-conflict-103369.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// #103369: don't complain about conflicting implementations with [const error]

pub trait ConstGenericTrait<const N: u32> {}

impl ConstGenericTrait<{my_fn(1)}> for () {}

impl ConstGenericTrait<{my_fn(2)}> for () {}

const fn my_fn(v: u32) -> u32 {
panic!("Some error occurred"); //~ ERROR E0080
//~| ERROR E0080
}

fn main() {}
39 changes: 39 additions & 0 deletions tests/ui/coherence/const-errs-dont-conflict-103369.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
error[E0080]: evaluation of constant value failed
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
|
LL | panic!("Some error occurred");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Some error occurred', $DIR/const-errs-dont-conflict-103369.rs:10:5
|
note: inside `my_fn`
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
|
LL | panic!("Some error occurred");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `<() as ConstGenericTrait<{my_fn(1)}>>::{constant#0}`
--> $DIR/const-errs-dont-conflict-103369.rs:5:25
|
LL | impl ConstGenericTrait<{my_fn(1)}> for () {}
| ^^^^^^^^
= 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)

error[E0080]: evaluation of constant value failed
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
|
LL | panic!("Some error occurred");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Some error occurred', $DIR/const-errs-dont-conflict-103369.rs:10:5
|
note: inside `my_fn`
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
|
LL | panic!("Some error occurred");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `<() as ConstGenericTrait<{my_fn(2)}>>::{constant#0}`
--> $DIR/const-errs-dont-conflict-103369.rs:7:25
|
LL | impl ConstGenericTrait<{my_fn(2)}> for () {}
| ^^^^^^^^
= 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)

error: aborting due to 2 previous errors

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

0 comments on commit 6108ac3

Please sign in to comment.