@@ -10,7 +10,6 @@ use rustc_attr::{
10
10
use rustc_data_structures:: unord:: UnordMap ;
11
11
use rustc_errors:: { Applicability , Diag , EmissionGuarantee } ;
12
12
use rustc_feature:: GateIssue ;
13
- use rustc_hir:: def:: DefKind ;
14
13
use rustc_hir:: def_id:: { DefId , LocalDefId , LocalDefIdMap } ;
15
14
use rustc_hir:: { self as hir, HirId } ;
16
15
use rustc_macros:: { Decodable , Encodable , HashStable , Subdiagnostic } ;
@@ -24,7 +23,7 @@ use rustc_span::symbol::{Symbol, sym};
24
23
use tracing:: debug;
25
24
26
25
pub use self :: StabilityLevel :: * ;
27
- use crate :: ty:: { self , TyCtxt } ;
26
+ use crate :: ty:: TyCtxt ;
28
27
29
28
#[ derive( PartialEq , Clone , Copy , Debug ) ]
30
29
pub enum StabilityLevel {
@@ -273,22 +272,6 @@ pub enum EvalResult {
273
272
Unmarked ,
274
273
}
275
274
276
- // See issue #38412.
277
- fn skip_stability_check_due_to_privacy ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> bool {
278
- if tcx. def_kind ( def_id) == DefKind :: TyParam {
279
- // Have no visibility, considered public for the purpose of this check.
280
- return false ;
281
- }
282
- match tcx. visibility ( def_id) {
283
- // Must check stability for `pub` items.
284
- ty:: Visibility :: Public => false ,
285
-
286
- // These are not visible outside crate; therefore
287
- // stability markers are irrelevant, if even present.
288
- ty:: Visibility :: Restricted ( ..) => true ,
289
- }
290
- }
291
-
292
275
// See issue #83250.
293
276
fn suggestion_for_allocator_api (
294
277
tcx : TyCtxt < ' _ > ,
@@ -407,11 +390,6 @@ impl<'tcx> TyCtxt<'tcx> {
407
390
def_id, span, stability
408
391
) ;
409
392
410
- // Issue #38412: private items lack stability markers.
411
- if skip_stability_check_due_to_privacy ( self , def_id) {
412
- return EvalResult :: Allow ;
413
- }
414
-
415
393
match stability {
416
394
Some ( Stability {
417
395
level : attr:: Unstable { reason, issue, is_soft, implied_by } ,
@@ -495,11 +473,6 @@ impl<'tcx> TyCtxt<'tcx> {
495
473
"body stability: inspecting def_id={def_id:?} span={span:?} of stability={stability:?}"
496
474
) ;
497
475
498
- // Issue #38412: private items lack stability markers.
499
- if skip_stability_check_due_to_privacy ( self , def_id) {
500
- return EvalResult :: Allow ;
501
- }
502
-
503
476
match stability {
504
477
Some ( DefaultBodyStability {
505
478
level : attr:: Unstable { reason, issue, is_soft, .. } ,
0 commit comments