diff options
| author | Camelid <camelidcamel@gmail.com> | 2021-03-13 13:25:27 -0800 |
|---|---|---|
| committer | Camelid <camelidcamel@gmail.com> | 2021-03-13 13:25:27 -0800 |
| commit | 7189c05bf8fe5b9d21815c44540d76301c90a8aa (patch) | |
| tree | 4398cc0d50679966385eb0b017f846d0ceda0906 /compiler/rustc_passes/src | |
| parent | 9613a88db5fd8bf3a882be35a9e8e87075e41bea (diff) | |
| download | rust-7189c05bf8fe5b9d21815c44540d76301c90a8aa.tar.gz rust-7189c05bf8fe5b9d21815c44540d76301c90a8aa.zip | |
Lint non-meta doc attributes
E.g., `#[doc(123)]`.
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index a045b0d596d..5120edb2e35 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -605,6 +605,16 @@ impl CheckAttrVisitor<'tcx> { return false; } } + } else { + self.tcx.struct_span_lint_hir( + INVALID_DOC_ATTRIBUTES, + hir_id, + meta.span(), + |lint| { + lint.build(&format!("unknown `doc` attribute")).emit(); + }, + ); + return false; } } } |
