Rollup merge of #102567 - compiler-errors:issue-102561, r=davidtwco

Delay evaluating lint primary message until after it would be suppressed

Fixes #102561
Fixes #102572
This commit is contained in:
Matthias Krüger 2022-10-04 06:14:11 +02:00 committed by GitHub
commit 8a0fda2ec1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View file

@ -0,0 +1,7 @@
#[macro_export]
macro_rules! foo {
() => {
let x: &Option<i32> = &Some(1);
let _y = x as *const Option<i32>;
}
}

View file

@ -0,0 +1,12 @@
// aux-build:trivial-cast-ice.rs
// check-pass
// Demonstrates the ICE in #102561
#![deny(trivial_casts)]
extern crate trivial_cast_ice;
fn main() {
trivial_cast_ice::foo!();
}