Test that cfg-gated if-exprs are not type-checked

This commit is contained in:
Aaron Hill 2020-02-19 11:01:51 -05:00
parent 7f19358c9e
commit 1b681d6652
No known key found for this signature in database
GPG Key ID: B4087E510E98B164

View File

@ -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) => {}
}