@@ -5,7 +5,7 @@ use crate::errors::{
5
5
CannotBeReexportedCratePublic , CannotBeReexportedCratePublicNS , CannotBeReexportedPrivate ,
6
6
CannotBeReexportedPrivateNS , CannotDetermineImportResolution , CannotGlobImportAllCrates ,
7
7
ConsiderAddingMacroExport , ConsiderMarkingAsPub , IsNotDirectlyImportable ,
8
- ItemsInTraitsAreNotImportable ,
8
+ ItemsInTraitsAreNotImportable , PrivateExternCrateReexport ,
9
9
} ;
10
10
use crate :: Determinacy :: { self , * } ;
11
11
use crate :: { module_to_string, names_to_string, ImportSuggestion } ;
@@ -25,8 +25,7 @@ use rustc_middle::metadata::Reexport;
25
25
use rustc_middle:: span_bug;
26
26
use rustc_middle:: ty;
27
27
use 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 ,
30
29
} ;
31
30
use rustc_session:: lint:: BuiltinLintDiag ;
32
31
use rustc_span:: edit_distance:: find_best_match_for_name;
@@ -1249,15 +1248,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
1249
1248
if !any_successful_reexport {
1250
1249
let ( ns, binding) = reexport_error. unwrap ( ) ;
1251
1250
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 ( ) ;
1261
1257
} else {
1262
1258
if ns == TypeNS {
1263
1259
let err = if crate_private_reexport {
0 commit comments