fix 142783
This commit is contained in:
parent
40a33af0f3
commit
f9cdf3fd74
2 changed files with 7 additions and 5 deletions
|
|
@ -722,9 +722,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
|||
// erroneously allowed it and some crates used it accidentally, to be compatible
|
||||
// with crates depending on them, we can't throw an error here.
|
||||
Target::Field | Target::Arm | Target::MacroDef => {
|
||||
for attr in attrs {
|
||||
self.inline_attr_str_error_with_macro_def(hir_id, attr.span(), "track_caller");
|
||||
}
|
||||
self.inline_attr_str_error_with_macro_def(hir_id, attr_span, "track_caller");
|
||||
}
|
||||
_ => {
|
||||
self.dcx().emit_err(errors::TrackedCallerWrongLocation {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
error: malformed `track_caller` attribute input
|
||||
error[E0565]: malformed `track_caller` attribute input
|
||||
--> $DIR/error-odd-syntax.rs:1:1
|
||||
|
|
||||
LL | #[track_caller(1)]
|
||||
| ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[track_caller]`
|
||||
| ^^^^^^^^^^^^^^---^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[track_caller]`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0565`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue