Test that cfg-gated if-exprs are not type-checked
This commit is contained in:
parent
7f19358c9e
commit
1b681d6652
@ -19,6 +19,18 @@ fn if_let() {
|
||||
#[attr] if let Some(_) = Some(true) {}
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
#[cfg(FALSE)]
|
||||
if true {
|
||||
let x: () = true; // Should not error due to the #[cfg(FALSE)]
|
||||
}
|
||||
|
||||
#[cfg_attr(not(unset_attr), cfg(FALSE))]
|
||||
if true {
|
||||
let a: () = true; // Should not error due to the applied #[cfg(FALSE)]
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! custom_macro {
|
||||
($expr:expr) => {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user