File tree Expand file tree Collapse file tree 3 files changed +29
-4
lines changed
test/ui/rfc-2091-track-caller Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ impl CheckAttrVisitor<'tcx> {
141141 target : Target ,
142142 ) -> bool {
143143 match target {
144- Target :: Fn if attr:: contains_name ( attrs, sym:: naked) => {
144+ _ if attr:: contains_name ( attrs, sym:: naked) => {
145145 struct_span_err ! (
146146 self . tcx. sess,
147147 * attr_span,
Original file line number Diff line number Diff line change 11#![ feature( naked_functions, track_caller) ]
22
3- #[ track_caller]
3+ #[ track_caller] //~ ERROR cannot use `#[track_caller]` with `#[naked]`
44#[ naked]
55fn 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+ }
720
821fn main ( ) { }
Original file line number Diff line number Diff line change @@ -4,6 +4,18 @@ error[E0736]: cannot use `#[track_caller]` with `#[naked]`
44LL | #[track_caller]
55 | ^^^^^^^^^^^^^^^
66
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
820
921For more information about this error, try `rustc --explain E0736`.
You can’t perform that action at this time.
0 commit comments