Skip to content

Commit ae97fcd

Browse files
committed
fix 142783
1 parent 9275099 commit ae97fcd

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_attr_data_structures::{AttributeKind, OptimizeAttr};
22
use rustc_feature::{AttributeTemplate, template};
33
use rustc_session::parse::feature_err;
4-
use rustc_span::{Span, sym};
4+
use rustc_span::{Span, Symbol, sym};
55

66
use super::{AcceptMapping, AttributeOrder, AttributeParser, OnDuplicate, SingleAttributeParser};
77
use crate::context::{AcceptContext, FinalizeContext, Stage};

compiler/rustc_passes/src/check_attr.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
704704
// erroneously allowed it and some crates used it accidentally, to be compatible
705705
// with crates depending on them, we can't throw an error here.
706706
Target::Field | Target::Arm | Target::MacroDef => {
707-
for attr in attrs {
708-
self.inline_attr_str_error_with_macro_def(hir_id, attr.span(), "track_caller");
709-
}
707+
self.inline_attr_str_error_with_macro_def(hir_id, attr_span, "track_caller");
710708
}
711709
_ => {
712710
self.dcx().emit_err(errors::TrackedCallerWrongLocation {
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
error: malformed `track_caller` attribute input
1+
error[E0565]: malformed `track_caller` attribute input
22
--> $DIR/error-odd-syntax.rs:1:1
33
|
44
LL | #[track_caller(1)]
5-
| ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[track_caller]`
5+
| ^^^^^^^^^^^^^^---^
6+
| | |
7+
| | didn't expect any arguments here
8+
| help: must be of the form: `#[track_caller]`
69

710
error: aborting due to 1 previous error
811

12+
For more information about this error, try `rustc --explain E0565`.

0 commit comments

Comments
 (0)