2019-07-27 00:54:25 +03:00
|
|
|
// run-pass
|
|
|
|
|
2013-11-24 11:48:46 +11:00
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
2014-04-14 21:00:31 +05:30
|
|
|
#![cfg(cfg_that_surely_doesnt_exist)]
|
2013-11-24 11:48:46 +11:00
|
|
|
|
|
|
|
fn method(&self) -> bool { false }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo {
|
2014-04-14 21:00:31 +05:30
|
|
|
#![cfg(not(cfg_that_surely_doesnt_exist))]
|
2013-11-24 11:48:46 +11: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());
|
|
|
|
}
|