]> git.lizzy.rs Git - rust.git/blob - src/test/ui/inner-attrs-on-impl.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[rust.git] / src / test / 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 }