@@ -5,7 +5,7 @@ use crate::errors::{
55 CannotBeReexportedCratePublic , CannotBeReexportedCratePublicNS , CannotBeReexportedPrivate ,
66 CannotBeReexportedPrivateNS , CannotDetermineImportResolution , CannotGlobImportAllCrates ,
77 ConsiderAddingMacroExport , ConsiderMarkingAsPub , IsNotDirectlyImportable ,
8- ItemsInTraitsAreNotImportable ,
8+ ItemsInTraitsAreNotImportable , PrivateExternCrateReexport ,
99} ;
1010use crate :: Determinacy :: { self , * } ;
1111use crate :: { module_to_string, names_to_string, ImportSuggestion } ;
@@ -25,8 +25,7 @@ use rustc_middle::metadata::Reexport;
2525use rustc_middle:: span_bug;
2626use rustc_middle:: ty;
2727use rustc_session:: lint:: builtin:: {
28- AMBIGUOUS_GLOB_REEXPORTS , HIDDEN_GLOB_REEXPORTS , PUB_USE_OF_PRIVATE_EXTERN_CRATE ,
29- UNUSED_IMPORTS ,
28+ AMBIGUOUS_GLOB_REEXPORTS , HIDDEN_GLOB_REEXPORTS , UNUSED_IMPORTS ,
3029} ;
3130use rustc_session:: lint:: BuiltinLintDiag ;
3231use rustc_span:: edit_distance:: find_best_match_for_name;
@@ -1249,15 +1248,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
12491248 if !any_successful_reexport {
12501249 let ( ns, binding) = reexport_error. unwrap ( ) ;
12511250 if let Some ( extern_crate_id) = pub_use_of_private_extern_crate_hack ( import, binding) {
1252- self . lint_buffer . buffer_lint (
1253- PUB_USE_OF_PRIVATE_EXTERN_CRATE ,
1254- import_id,
1255- import. span ,
1256- BuiltinLintDiag :: PrivateExternCrateReexport {
1257- source : ident,
1258- extern_crate_span : self . tcx . source_span ( self . local_def_id ( extern_crate_id) ) ,
1259- } ,
1260- ) ;
1251+ let err = self . dcx ( ) . create_err ( PrivateExternCrateReexport {
1252+ span : import. span ,
1253+ ident,
1254+ sugg : self . tcx . source_span ( self . local_def_id ( extern_crate_id) ) . shrink_to_lo ( ) ,
1255+ } ) ;
1256+ err. emit ( ) ;
12611257 } else {
12621258 if ns == TypeNS {
12631259 let err = if crate_private_reexport {
0 commit comments