Skip to content

Commit

Permalink
Test that cfg-gated if-exprs are not type-checked
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Mar 4, 2020
1 parent 7f19358 commit 1b681d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/ui/if-attrs/cfg-false-if-attr.rs
Expand Up @@ -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) => {}
}
Expand Down

0 comments on commit 1b681d6

Please sign in to comment.