File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
compiler/rustc_middle/src Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -217,12 +217,19 @@ fn explain_lint_level_source(
217
217
src : LintLevelSource ,
218
218
err : & mut Diag < ' _ , ( ) > ,
219
219
) {
220
- fn lint_group_name ( lint : & ' static Lint , sess : & Session ) -> Option < & ' static str > {
220
+ fn lint_group_name (
221
+ lint : & ' static Lint ,
222
+ sess : & Session ,
223
+ allow_external : bool ,
224
+ ) -> Option < & ' static str > {
221
225
let mut lint_groups_iter = sess. lint_groups ( ) ;
222
226
let lint_id = LintId :: of ( lint) ;
223
227
lint_groups_iter
224
228
. find ( |lint_group| {
225
229
let lints = & lint_group. 1 ;
230
+ if !allow_external && lint_group. 2 {
231
+ return false ;
232
+ }
226
233
lints. iter ( ) . find ( |lint_group_lint| * * lint_group_lint == lint_id) . is_some ( )
227
234
} )
228
235
. map ( |lint_group| lint_group. 0 )
@@ -236,7 +243,7 @@ fn explain_lint_level_source(
236
243
match src {
237
244
LintLevelSource :: Default => {
238
245
let level_str = level. as_str ( ) ;
239
- match lint_group_name ( lint, sess) {
246
+ match lint_group_name ( lint, sess, false ) {
240
247
Some ( group_name) => {
241
248
err. note_once ( format ! ( "`#[{level_str}({name})]` (part of `#[{level_str}({group_name})]`) on by default" ) ) ;
242
249
}
You can’t perform that action at this time.
0 commit comments