File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ // Tests whether only one EII attribute cane be applied to a signature.
2+ #![ feature( eii) ]
3+
4+ #[ eii( a) ]
5+ #[ eii( b) ]
6+ //~^ ERROR `#[eii]` can only be specified once
7+ fn a ( x : u64 ) ;
8+
9+ #[ a]
10+ fn implementation ( x : u64 ) {
11+ println ! ( "{x:?}" )
12+ }
13+
14+ // what you would write:
15+ fn main ( ) {
16+ a ( 42 ) ;
17+ }
Original file line number Diff line number Diff line change 1+ error: `#[eii]` can only be specified once
2+ --> $DIR/multiple_decls.rs:5:1
3+ |
4+ LL | #[eii(b)]
5+ | ^^^^^^^^^
6+ |
7+ note: specified again here
8+ --> $DIR/multiple_decls.rs:4:1
9+ |
10+ LL | #[eii(a)]
11+ | ^^^^^^^^^
12+
13+ error: aborting due to 1 previous error
14+
Original file line number Diff line number Diff line change 1+ //@ run-pass
2+ //@ check-run-results
3+ //@ ignore-backends: gcc
4+ // Tests whether one function could implement two EIIs.
5+ #![ feature( eii) ]
6+
7+ #[ eii]
8+ fn a ( x : u64 ) ;
9+
10+ #[ eii]
11+ fn b ( x : u64 ) ;
12+
13+ #[ a]
14+ #[ b]
15+ fn implementation ( x : u64 ) {
16+ println ! ( "{x:?}" )
17+ }
18+
19+ // what you would write:
20+ fn main ( ) {
21+ a ( 42 ) ;
22+ b ( 42 ) ;
23+ }
Original file line number Diff line number Diff line change 1+ 42
2+ 42
You can’t perform that action at this time.
0 commit comments