mirror of https://github.com/rust-lang/rust.git
25 lines
405 B
Rust
25 lines
405 B
Rust
|
//@ run-pass
|
||
|
|
||
|
struct Foo;
|
||
|
|
||
|
impl Foo {
|
||
|
#![cfg(cfg_that_surely_doesnt_exist)]
|
||
|
|
||
|
fn method(&self) -> bool { false }
|
||
|
}
|
||
|
|
||
|
impl Foo {
|
||
|
#![cfg(not(cfg_that_surely_doesnt_exist))]
|
||
|
|
||
|
// 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());
|
||
|
}
|