blob: e7a5cfa9e2f533aa981aca79ee7f9085596daab0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
//! Test inner attributes (#![...]) behavior in impl blocks with cfg conditions.
//!
//! This test verifies that:
//! - Inner attributes can conditionally exclude entire impl blocks
//! - Regular attributes within impl blocks work independently
//! - Attribute parsing doesn't consume too eagerly
//@ run-pass
struct Foo;
impl Foo {
#![cfg(false)]
fn method(&self) -> bool {
false
}
}
impl Foo {
#![cfg(not(FALSE))]
// Check that we don't eat attributes too eagerly.
#[cfg(false)]
fn method(&self) -> bool {
false
}
fn method(&self) -> bool {
true
}
}
pub fn main() {
assert!(Foo.method());
}
|