@@ -8,7 +8,7 @@ use crate::hir::map as hir_map;
88use crate :: hir:: map:: DefPathHash ;
99use crate :: ich:: { NodeIdHashingMode , StableHashingContext } ;
1010use crate :: infer:: canonical:: { Canonical , CanonicalVarInfo , CanonicalVarInfos } ;
11- use crate :: lint:: { self , Lint } ;
11+ use crate :: lint:: { maybe_lint_level_root , struct_lint_level , LintSource , LintStore } ;
1212use crate :: middle;
1313use crate :: middle:: cstore:: CrateStoreDyn ;
1414use crate :: middle:: cstore:: EncodedMetadata ;
@@ -61,6 +61,7 @@ use rustc_data_structures::sync::{Lock, Lrc, WorkerLocal};
6161use rustc_errors:: DiagnosticBuilder ;
6262use rustc_index:: vec:: { Idx , IndexVec } ;
6363use rustc_macros:: HashStable ;
64+ use rustc_session:: lint:: { Level , Lint } ;
6465use rustc_session:: node_id:: NodeMap ;
6566use rustc_span:: source_map:: MultiSpan ;
6667use rustc_span:: symbol:: { kw, sym, Symbol } ;
@@ -946,7 +947,7 @@ pub struct GlobalCtxt<'tcx> {
946947
947948 pub sess : & ' tcx Session ,
948949
949- pub lint_store : Lrc < lint :: LintStore > ,
950+ pub lint_store : Lrc < LintStore > ,
950951
951952 pub dep_graph : DepGraph ,
952953
@@ -1115,7 +1116,7 @@ impl<'tcx> TyCtxt<'tcx> {
11151116 /// reference to the context, to allow formatting values that need it.
11161117 pub fn create_global_ctxt (
11171118 s : & ' tcx Session ,
1118- lint_store : Lrc < lint :: LintStore > ,
1119+ lint_store : Lrc < LintStore > ,
11191120 local_providers : ty:: query:: Providers < ' tcx > ,
11201121 extern_providers : ty:: query:: Providers < ' tcx > ,
11211122 arenas : & ' tcx AllArenas ,
@@ -2551,21 +2552,21 @@ impl<'tcx> TyCtxt<'tcx> {
25512552 iter. intern_with ( |xs| self . intern_goals ( xs) )
25522553 }
25532554
2554- pub fn lint_hir < S : Into < MultiSpan > > (
2555+ pub fn lint_hir (
25552556 self ,
25562557 lint : & ' static Lint ,
25572558 hir_id : HirId ,
2558- span : S ,
2559+ span : impl Into < MultiSpan > ,
25592560 msg : & str ,
25602561 ) {
25612562 self . struct_span_lint_hir ( lint, hir_id, span. into ( ) , msg) . emit ( )
25622563 }
25632564
2564- pub fn lint_hir_note < S : Into < MultiSpan > > (
2565+ pub fn lint_hir_note (
25652566 self ,
25662567 lint : & ' static Lint ,
25672568 hir_id : HirId ,
2568- span : S ,
2569+ span : impl Into < MultiSpan > ,
25692570 msg : & str ,
25702571 note : & str ,
25712572 ) {
@@ -2574,11 +2575,11 @@ impl<'tcx> TyCtxt<'tcx> {
25742575 err. emit ( )
25752576 }
25762577
2577- pub fn lint_node_note < S : Into < MultiSpan > > (
2578+ pub fn lint_node_note (
25782579 self ,
25792580 lint : & ' static Lint ,
25802581 id : hir:: HirId ,
2581- span : S ,
2582+ span : impl Into < MultiSpan > ,
25822583 msg : & str ,
25832584 note : & str ,
25842585 ) {
@@ -2598,7 +2599,7 @@ impl<'tcx> TyCtxt<'tcx> {
25982599 if id == bound {
25992600 return bound;
26002601 }
2601- if lint :: maybe_lint_level_root ( self , id) {
2602+ if maybe_lint_level_root ( self , id) {
26022603 return id;
26032604 }
26042605 let next = self . hir ( ) . get_parent_node ( id) ;
@@ -2613,7 +2614,7 @@ impl<'tcx> TyCtxt<'tcx> {
26132614 self ,
26142615 lint : & ' static Lint ,
26152616 mut id : hir:: HirId ,
2616- ) -> ( lint :: Level , lint :: LintSource ) {
2617+ ) -> ( Level , LintSource ) {
26172618 let sets = self . lint_levels ( LOCAL_CRATE ) ;
26182619 loop {
26192620 if let Some ( pair) = sets. level_and_source ( lint, id, self . sess ) {
@@ -2627,15 +2628,15 @@ impl<'tcx> TyCtxt<'tcx> {
26272628 }
26282629 }
26292630
2630- pub fn struct_span_lint_hir < S : Into < MultiSpan > > (
2631+ pub fn struct_span_lint_hir (
26312632 self ,
26322633 lint : & ' static Lint ,
26332634 hir_id : HirId ,
2634- span : S ,
2635+ span : impl Into < MultiSpan > ,
26352636 msg : & str ,
26362637 ) -> DiagnosticBuilder < ' tcx > {
26372638 let ( level, src) = self . lint_level_at_node ( lint, hir_id) ;
2638- lint :: struct_lint_level ( self . sess , lint, level, src, Some ( span. into ( ) ) , msg)
2639+ struct_lint_level ( self . sess , lint, level, src, Some ( span. into ( ) ) , msg)
26392640 }
26402641
26412642 pub fn struct_lint_node (
@@ -2645,7 +2646,7 @@ impl<'tcx> TyCtxt<'tcx> {
26452646 msg : & str ,
26462647 ) -> DiagnosticBuilder < ' tcx > {
26472648 let ( level, src) = self . lint_level_at_node ( lint, id) ;
2648- lint :: struct_lint_level ( self . sess , lint, level, src, None , msg)
2649+ struct_lint_level ( self . sess , lint, level, src, None , msg)
26492650 }
26502651
26512652 pub fn in_scope_traits ( self , id : HirId ) -> Option < & ' tcx StableVec < TraitCandidate > > {
0 commit comments