1 // run-pass 2 3 struct Foo; 4 5 impl Foo { 6 #![cfg(cfg_that_surely_doesnt_exist)] 7 method(&self) -> bool8 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)] method(&self) -> bool16 fn method(&self) -> bool { false } 17 method(&self) -> bool18 fn method(&self) -> bool { true } 19 } 20 21 main()22pub fn main() { 23 assert!(Foo.method()); 24 } 25