@@ -238,20 +238,21 @@ fn get_first_segment<'tcx>(path: &Path<'tcx>) -> Option<&'tcx PathSegment<'tcx>>
238238/// Does not catch individually moved items
239239fn is_stable ( cx : & LateContext < ' _ > , mut def_id : DefId , msrv : Msrv ) -> bool {
240240 loop {
241- if let Some ( stability) = cx. tcx . lookup_stability ( def_id)
242- && let StabilityLevel :: Stable {
243- since,
244- allowed_through_unstable_modules : None ,
245- } = stability. level
246- {
247- let stable = match since {
248- StableSince :: Version ( v) => msrv. meets ( cx, v) ,
249- StableSince :: Current => msrv. current ( cx) . is_none ( ) ,
250- StableSince :: Err ( _) => false ,
251- } ;
252-
253- if !stable {
254- return false ;
241+ if let Some ( stability) = cx. tcx . lookup_stability ( def_id) {
242+ match stability. level {
243+ // Workaround for items from `core::intrinsics` with a stable export in a different module.
244+ // Not that we ignore the `since` field as we are already accessing the item in question.
245+ StabilityLevel :: Stable {
246+ allowed_through_unstable_modules : Some ( _) ,
247+ ..
248+ } => return true ,
249+ StabilityLevel :: Stable { since, .. } => match since {
250+ StableSince :: Version ( v) if !msrv. meets ( cx, v) => return false ,
251+ StableSince :: Current if msrv. current ( cx) . is_none ( ) => return false ,
252+ StableSince :: Err ( _) => return false ,
253+ StableSince :: Version ( _) | StableSince :: Current => { } ,
254+ } ,
255+ StabilityLevel :: Unstable { .. } => return false ,
255256 }
256257 }
257258
0 commit comments