File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 3
3
#![ feature( impl_stability) ]
4
4
#![ stable( feature = "a" , since = "1.1.1" ) ]
5
5
6
-
7
- /// FIXME(tiif): we haven't allowed marking impl method as
6
+ /// FIXME(tiif): we haven't allowed marking trait and impl method as
8
7
/// unstable yet, but it should be possible.
9
8
10
9
#[ stable( feature = "a" , since = "1.1.1" ) ]
11
10
pub trait Trait {
12
11
#[ unstable( feature = "feat" , issue = "none" ) ]
13
12
#[ unstable_feature_bound( foo) ]
13
+ //~^ ERROR: attribute should be applied to `impl` or free function outside of any `impl` or trait
14
14
fn foo ( ) ;
15
15
}
16
16
17
17
#[ stable( feature = "a" , since = "1.1.1" ) ]
18
18
impl Trait for u8 {
19
19
#[ unstable_feature_bound( foo) ]
20
+ //~^ ERROR: attribute should be applied to `impl` or free function outside of any `impl` or trait
20
21
fn foo ( ) { }
21
22
}
22
23
Original file line number Diff line number Diff line change
1
+ error: attribute should be applied to `impl` or free function outside of any `impl` or trait
2
+ --> $DIR/unstable_inherent_method.rs:12:5
3
+ |
4
+ LL | #[unstable_feature_bound(foo)]
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
+ LL |
7
+ LL | fn foo();
8
+ | --------- not an `impl` or free function
9
+
10
+ error: attribute should be applied to `impl` or free function outside of any `impl` or trait
11
+ --> $DIR/unstable_inherent_method.rs:19:5
12
+ |
13
+ LL | #[unstable_feature_bound(foo)]
14
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15
+ LL |
16
+ LL | fn foo() {}
17
+ | ----------- not an `impl` or free function
18
+
19
+ error: aborting due to 2 previous errors
20
+
You can’t perform that action at this time.
0 commit comments