about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAfnan Enayet <afnan@afnan.io>2020-01-03 17:27:14 -0800
committerAfnan Enayet <afnan@afnan.io>2020-01-12 23:21:02 -0800
commit9d95eaa49b095c396eaee3d3cb62e60df8e81a2f (patch)
treee03def1cf711d1834bf24688990217db327086db
parente82febc78e5a14356de5f713b904eebef1e86956 (diff)
downloadrust-9d95eaa49b095c396eaee3d3cb62e60df8e81a2f.tar.gz
rust-9d95eaa49b095c396eaee3d3cb62e60df8e81a2f.zip
Use `report_in_external_macro` for internal lints
Add the option to report lints in external macros for rustc internal
lints
-rw-r--r--src/librustc_lint/internal.rs12
-rw-r--r--src/librustc_span/symbol.rs1
2 files changed, 9 insertions, 4 deletions
diff --git a/src/librustc_lint/internal.rs b/src/librustc_lint/internal.rs
index 2f8393bd906..5a5aedc2e97 100644
--- a/src/librustc_lint/internal.rs
+++ b/src/librustc_lint/internal.rs
@@ -12,7 +12,8 @@ use syntax::ast::{Ident, Item, ItemKind};
 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 @@ impl EarlyLintPass for DefaultHashTypes {
 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 => [
diff --git a/src/librustc_span/symbol.rs b/src/librustc_span/symbol.rs
index a8b2db300a4..889f6099070 100644
--- a/src/librustc_span/symbol.rs
+++ b/src/librustc_span/symbol.rs
@@ -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;