]> git.lizzy.rs Git - rust.git/blob - tests/ui/inner-attrs-on-impl.rs
Rollup merge of #106106 - jyn514:remote-tracking-branch, r=Mark-Simulacrum
[rust.git] / tests / ui / inner-attrs-on-impl.rs
1 // run-pass
2
3 struct Foo;
4
5 impl Foo {
6     #![cfg(cfg_that_surely_doesnt_exist)]
7
8     fn method(&self) -> bool { false }
9 }
10
11 impl Foo {
12     #![cfg(not(cfg_that_surely_doesnt_exist))]
13
14     // check that we don't eat attributes too eagerly.
15     #[cfg(cfg_that_surely_doesnt_exist)]
16     fn method(&self) -> bool { false }
17
18     fn method(&self) -> bool { true }
19 }
20
21
22 pub fn main() {
23     assert!(Foo.method());
24 }