Skip to content

Commit 9d95eaa

Browse files
committed
Use report_in_external_macro for internal lints
Add the option to report lints in external macros for rustc internal lints
1 parent e82febc commit 9d95eaa

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/librustc_lint/internal.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use syntax::ast::{Ident, Item, ItemKind};
1212
declare_tool_lint! {
1313
pub rustc::DEFAULT_HASH_TYPES,
1414
Allow,
15-
"forbid HashMap and HashSet and suggest the FxHash* variants"
15+
"forbid HashMap and HashSet and suggest the FxHash* variants",
16+
report_in_external_macro: true
1617
}
1718

1819
pub struct DefaultHashTypes {
@@ -52,19 +53,22 @@ impl EarlyLintPass for DefaultHashTypes {
5253
declare_tool_lint! {
5354
pub rustc::USAGE_OF_TY_TYKIND,
5455
Allow,
55-
"usage of `ty::TyKind` outside of the `ty::sty` module"
56+
"usage of `ty::TyKind` outside of the `ty::sty` module",
57+
report_in_external_macro: true
5658
}
5759

5860
declare_tool_lint! {
5961
pub rustc::TY_PASS_BY_REFERENCE,
6062
Allow,
61-
"passing `Ty` or `TyCtxt` by reference"
63+
"passing `Ty` or `TyCtxt` by reference",
64+
report_in_external_macro: true
6265
}
6366

6467
declare_tool_lint! {
6568
pub rustc::USAGE_OF_QUALIFIED_TY,
6669
Allow,
67-
"using `ty::{Ty,TyCtxt}` instead of importing it"
70+
"using `ty::{Ty,TyCtxt}` instead of importing it",
71+
report_in_external_macro: true
6872
}
6973

7074
declare_lint_pass!(TyTyKind => [

src/librustc_span/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ pub mod kw {
10491049
}
10501050

10511051
// This module has a very short name because it's used a lot.
1052+
#[allow(rustc::default_hash_types)]
10521053
pub mod sym {
10531054
use super::Symbol;
10541055
use std::convert::TryInto;

0 commit comments

Comments
 (0)