@@ -13,6 +13,7 @@ use thin_vec::ThinVec;
1313use super :: prelude:: { ALL_TARGETS , AllowedTargets } ;
1414use super :: { AcceptMapping , AttributeParser } ;
1515use crate :: context:: { AcceptContext , FinalizeContext , Stage } ;
16+ use crate :: errors:: { DocAliasDuplicated , DocAutoCfgExpectsHideOrShow , IllFormedAttributeInput } ;
1617use crate :: parser:: { ArgParser , MetaItemOrLitParser , MetaItemParser , OwnedPathParser } ;
1718use crate :: session_diagnostics:: {
1819 DocAliasBadChar , DocAliasEmpty , DocAliasMalformed , DocAliasStartEnd , DocAttrNotCrateLevel ,
@@ -257,9 +258,7 @@ impl DocParser {
257258 if let Some ( first_definition) = self . attribute . aliases . get ( & alias) . copied ( ) {
258259 cx. emit_dyn_lint (
259260 rustc_session:: lint:: builtin:: UNUSED_ATTRIBUTES ,
260- move |dcx, level| {
261- crate :: errors:: DocAliasDuplicated { first_definition } . into_diag ( dcx, level)
262- } ,
261+ move |dcx, level| DocAliasDuplicated { first_definition } . into_diag ( dcx, level) ,
263262 span,
264263 ) ;
265264 }
@@ -345,9 +344,9 @@ impl DocParser {
345344 ArgParser :: List ( list) => {
346345 for meta in list. mixed ( ) {
347346 let MetaItemOrLitParser :: MetaItemParser ( item) = meta else {
348- cx. emit_lint (
347+ cx. emit_dyn_lint (
349348 rustc_session:: lint:: builtin:: INVALID_DOC_ATTRIBUTES ,
350- AttributeLintKind :: DocAutoCfgExpectsHideOrShow ,
349+ |dcx , level| DocAutoCfgExpectsHideOrShow . into_diag ( dcx , level ) ,
351350 meta. span ( ) ,
352351 ) ;
353352 continue ;
@@ -356,9 +355,9 @@ impl DocParser {
356355 Some ( sym:: hide) => ( HideOrShow :: Hide , sym:: hide) ,
357356 Some ( sym:: show) => ( HideOrShow :: Show , sym:: show) ,
358357 _ => {
359- cx. emit_lint (
358+ cx. emit_dyn_lint (
360359 rustc_session:: lint:: builtin:: INVALID_DOC_ATTRIBUTES ,
361- AttributeLintKind :: DocAutoCfgExpectsHideOrShow ,
360+ |dcx , level| DocAutoCfgExpectsHideOrShow . into_diag ( dcx , level ) ,
362361 item. span ( ) ,
363362 ) ;
364363 continue ;
@@ -671,8 +670,7 @@ impl DocParser {
671670 cx. emit_dyn_lint (
672671 rustc_session:: lint:: builtin:: INVALID_DOC_ATTRIBUTES ,
673672 move |dcx, level| {
674- crate :: errors:: IllFormedAttributeInput :: new ( & suggestions, None , None )
675- . into_diag ( dcx, level)
673+ IllFormedAttributeInput :: new ( & suggestions, None , None ) . into_diag ( dcx, level)
676674 } ,
677675 span,
678676 ) ;
0 commit comments