]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #67854 - afnanenayet:afnan/report-external-macro-lints, r=petrochenkov
authorYuki Okushi <huyuumi.dev@gmail.com>
Tue, 14 Jan 2020 05:02:16 +0000 (14:02 +0900)
committerGitHub <noreply@github.com>
Tue, 14 Jan 2020 05:02:16 +0000 (14:02 +0900)
Use `report_in_external_macro` for internal lints

Add the option to report lints in external macros for rustc internal lints to resolve #66370

src/librustc_lint/internal.rs
src/librustc_span/symbol.rs

index 2f8393bd906c0e0f9bdfea87072deec9dbe30ecb..5a5aedc2e9715b33bff96069e1868ab2b43fa0d7 100644 (file)
@@ -12,7 +12,8 @@
 declare_tool_lint! {
     pub rustc::DEFAULT_HASH_TYPES,
     Allow,
-    "forbid HashMap and HashSet and suggest the FxHash* variants"
+    "forbid HashMap and HashSet and suggest the FxHash* variants",
+    report_in_external_macro: true
 }
 
 pub struct DefaultHashTypes {
@@ -52,19 +53,22 @@ fn check_ident(&mut self, cx: &EarlyContext<'_>, ident: Ident) {
 declare_tool_lint! {
     pub rustc::USAGE_OF_TY_TYKIND,
     Allow,
-    "usage of `ty::TyKind` outside of the `ty::sty` module"
+    "usage of `ty::TyKind` outside of the `ty::sty` module",
+    report_in_external_macro: true
 }
 
 declare_tool_lint! {
     pub rustc::TY_PASS_BY_REFERENCE,
     Allow,
-    "passing `Ty` or `TyCtxt` by reference"
+    "passing `Ty` or `TyCtxt` by reference",
+    report_in_external_macro: true
 }
 
 declare_tool_lint! {
     pub rustc::USAGE_OF_QUALIFIED_TY,
     Allow,
-    "using `ty::{Ty,TyCtxt}` instead of importing it"
+    "using `ty::{Ty,TyCtxt}` instead of importing it",
+    report_in_external_macro: true
 }
 
 declare_lint_pass!(TyTyKind => [
index a8b2db300a478c51b2db47ee8fc3e6d13d9c1c5b..889f6099070aebc863863ff68c56d28157ca4a2f 100644 (file)
@@ -1049,6 +1049,7 @@ pub mod kw {
 }
 
 // This module has a very short name because it's used a lot.
+#[allow(rustc::default_hash_types)]
 pub mod sym {
     use super::Symbol;
     use std::convert::TryInto;