Add tests for #12669

This commit is contained in:
Florian Diebold 2022-07-01 16:32:54 +02:00
parent 994f3cf74d
commit e71519572c
2 changed files with 81 additions and 0 deletions

View file

@ -104,6 +104,25 @@ fn f() {
);
}
#[test]
fn inactive_assoc_item() {
// FIXME these currently don't work, hence the *
check(
r#"
struct Foo;
impl Foo {
#[cfg(any())] pub fn f() {}
//*************************** weak: code is inactive due to #[cfg] directives
}
trait Bar {
#[cfg(any())] pub fn f() {}
//*************************** weak: code is inactive due to #[cfg] directives
}
"#,
);
}
/// Tests that `cfg` attributes behind `cfg_attr` is handled properly.
#[test]
fn inactive_via_cfg_attr() {