@@ -7,7 +7,7 @@ use std::sync::LazyLock;
77
88use private:: Sealed ;
99use rustc_ast:: { AttrStyle , MetaItemLit , NodeId } ;
10- use rustc_errors:: { Diag , Diagnostic , Level } ;
10+ use rustc_errors:: { Diag , Diagnostic , Level , MultiSpan } ;
1111use rustc_feature:: { AttrSuggestionStyle , AttributeTemplate } ;
1212use rustc_hir:: attrs:: AttributeKind ;
1313use rustc_hir:: lints:: AttributeLintKind ;
@@ -455,14 +455,19 @@ impl<'f, 'sess: 'f, S: Stage> SharedContext<'f, 'sess, S> {
455455 /// Emit a lint. This method is somewhat special, since lints emitted during attribute parsing
456456 /// must be delayed until after HIR is built. This method will take care of the details of
457457 /// that.
458- pub ( crate ) fn emit_lint ( & mut self , lint : & ' static Lint , kind : AttributeLintKind , span : Span ) {
458+ pub ( crate ) fn emit_lint < M : Into < MultiSpan > > (
459+ & mut self ,
460+ lint : & ' static Lint ,
461+ kind : AttributeLintKind ,
462+ span : M ,
463+ ) {
459464 if !matches ! (
460465 self . stage. should_emit( ) ,
461466 ShouldEmit :: ErrorsAndLints { .. } | ShouldEmit :: EarlyFatal { also_emit_lints: true }
462467 ) {
463468 return ;
464469 }
465- ( self . emit_lint ) ( LintId :: of ( lint) , span, kind) ;
470+ ( self . emit_lint ) ( LintId :: of ( lint) , span. into ( ) , kind) ;
466471 }
467472
468473 pub ( crate ) fn warn_unused_duplicate ( & mut self , used_span : Span , unused_span : Span ) {
@@ -528,7 +533,7 @@ pub struct SharedContext<'p, 'sess, S: Stage> {
528533
529534 /// The second argument of the closure is a [`NodeId`] if `S` is `Early` and a [`HirId`] if `S`
530535 /// is `Late` and is the ID of the syntactical component this attribute was applied to.
531- pub ( crate ) emit_lint : & ' p mut dyn FnMut ( LintId , Span , AttributeLintKind ) ,
536+ pub ( crate ) emit_lint : & ' p mut dyn FnMut ( LintId , MultiSpan , AttributeLintKind ) ,
532537}
533538
534539/// Context given to every attribute parser during finalization.
0 commit comments