2019-07-26 16:54:25 -05:00
|
|
|
// run-pass
|
|
|
|
|
2013-11-23 18:48:46 -06:00
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
2014-04-14 10:30:31 -05:00
|
|
|
#![cfg(cfg_that_surely_doesnt_exist)]
|
2013-11-23 18:48:46 -06:00
|
|
|
|
|
|
|
fn method(&self) -> bool { false }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo {
|
2014-04-14 10:30:31 -05:00
|
|
|
#![cfg(not(cfg_that_surely_doesnt_exist))]
|
2013-11-23 18:48:46 -06:00
|
|
|
|
|
|
|
// check that we don't eat attributes too eagerly.
|
|
|
|
#[cfg(cfg_that_surely_doesnt_exist)]
|
|
|
|
fn method(&self) -> bool { false }
|
|
|
|
|
|
|
|
fn method(&self) -> bool { true }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
assert!(Foo.method());
|
|
|
|
}
|