Rollup merge of #55474 - oli-obk:const_eval_promoted, r=RalfJung
Fix validation false positive Fixes #55454 r? @RalfJung
This commit is contained in:
commit
3176239d34
4 changed files with 25 additions and 2 deletions
9
src/test/ui/consts/const-validation-fail-55455.rs
Normal file
9
src/test/ui/consts/const-validation-fail-55455.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// https://github.com/rust-lang/rust/issues/55454
|
||||
// compile-pass
|
||||
|
||||
struct This<T>(T);
|
||||
|
||||
const C: This<Option<&i32>> = This(Some(&1));
|
||||
|
||||
fn main() {
|
||||
}
|
||||
9
src/test/ui/consts/promoted-validation-55454.rs
Normal file
9
src/test/ui/consts/promoted-validation-55454.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// https://github.com/rust-lang/rust/issues/55454
|
||||
// compile-pass
|
||||
|
||||
#[derive(PartialEq)]
|
||||
struct This<T>(T);
|
||||
|
||||
fn main() {
|
||||
This(Some(&1)) == This(Some(&1));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue