File tree 3 files changed +29
-4
lines changed
test/ui/rfc-2091-track-caller
3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ impl CheckAttrVisitor<'tcx> {
141
141
target : Target ,
142
142
) -> bool {
143
143
match target {
144
- Target :: Fn if attr:: contains_name ( attrs, sym:: naked) => {
144
+ _ if attr:: contains_name ( attrs, sym:: naked) => {
145
145
struct_span_err ! (
146
146
self . tcx. sess,
147
147
* attr_span,
Original file line number Diff line number Diff line change 1
1
#![ feature( naked_functions, track_caller) ]
2
2
3
- #[ track_caller]
3
+ #[ track_caller] //~ ERROR cannot use `#[track_caller]` with `#[naked]`
4
4
#[ naked]
5
5
fn f ( ) { }
6
- //~^^^ ERROR cannot use `#[track_caller]` with `#[naked]`
6
+
7
+ struct S ;
8
+
9
+ impl S {
10
+ #[ track_caller] //~ ERROR cannot use `#[track_caller]` with `#[naked]`
11
+ #[ naked]
12
+ fn g ( ) { }
13
+ }
14
+
15
+ extern "Rust" {
16
+ #[ track_caller] //~ ERROR cannot use `#[track_caller]` with `#[naked]`
17
+ #[ naked]
18
+ fn h ( ) ;
19
+ }
7
20
8
21
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -4,6 +4,18 @@ error[E0736]: cannot use `#[track_caller]` with `#[naked]`
4
4
LL | #[track_caller]
5
5
| ^^^^^^^^^^^^^^^
6
6
7
- error: aborting due to previous error
7
+ error[E0736]: cannot use `#[track_caller]` with `#[naked]`
8
+ --> $DIR/error-with-naked.rs:16:5
9
+ |
10
+ LL | #[track_caller]
11
+ | ^^^^^^^^^^^^^^^
12
+
13
+ error[E0736]: cannot use `#[track_caller]` with `#[naked]`
14
+ --> $DIR/error-with-naked.rs:10:5
15
+ |
16
+ LL | #[track_caller]
17
+ | ^^^^^^^^^^^^^^^
18
+
19
+ error: aborting due to 3 previous errors
8
20
9
21
For more information about this error, try `rustc --explain E0736`.
You can’t perform that action at this time.
0 commit comments