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