File tree 5 files changed +44
-3
lines changed
5 files changed +44
-3
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,27 @@ impl Item {
400
400
}
401
401
402
402
pub ( crate ) fn deprecation ( & self , tcx : TyCtxt < ' _ > ) -> Option < Deprecation > {
403
- self . def_id ( ) . and_then ( |did| tcx. lookup_deprecation ( did) )
403
+ self . def_id ( ) . and_then ( |did| tcx. lookup_deprecation ( did) ) . or_else ( || {
404
+ // `allowed_through_unstable_modules` is a bug-compatibility hack for old rustc
405
+ // versions; the paths that are exposed through it are "deprecated" because they
406
+ // were never supposed to work at all.
407
+ let stab = self . stability ( tcx) ?;
408
+ if let rustc_attr_parsing:: StabilityLevel :: Stable {
409
+ allowed_through_unstable_modules : true ,
410
+ ..
411
+ } = stab. level
412
+ {
413
+ Some ( Deprecation {
414
+ // FIXME(#131676, #135003): when a note is added to this stability tag,
415
+ // translate it here
416
+ since : rustc_attr_parsing:: DeprecatedSince :: Unspecified ,
417
+ note : None ,
418
+ suggestion : None ,
419
+ } )
420
+ } else {
421
+ None
422
+ }
423
+ } )
404
424
}
405
425
406
426
pub ( crate ) fn inner_docs ( & self , tcx : TyCtxt < ' _ > ) -> bool {
Original file line number Diff line number Diff line change @@ -107,6 +107,14 @@ fn merge_stability(
107
107
|| parent_stab. stable_since ( ) . is_some_and ( |parent_since| parent_since > own_since) )
108
108
{
109
109
parent_stability
110
+ } else if let Some ( mut own_stab) = own_stability
111
+ && let StabilityLevel :: Stable { since, allowed_through_unstable_modules : true } =
112
+ own_stab. level
113
+ && parent_stability. is_some_and ( |stab| stab. is_stable ( ) )
114
+ {
115
+ // this property does not apply transitively through re-exports
116
+ own_stab. level = StabilityLevel :: Stable { since, allowed_through_unstable_modules : false } ;
117
+ Some ( own_stab)
110
118
} else {
111
119
own_stability
112
120
}
Original file line number Diff line number Diff line change
1
+ const FILTER_CRATE = "core" ;
2
+ const EXPECTED = [
3
+ {
4
+ 'query' : 'generic:T -> generic:U' ,
5
+ 'others' : [
6
+ { 'path' : 'core::intrinsics::simd' , 'name' : 'simd_as' } ,
7
+ { 'path' : 'core::intrinsics::simd' , 'name' : 'simd_cast' } ,
8
+ { 'path' : 'core::mem' , 'name' : 'transmute' } ,
9
+ ] ,
10
+ } ,
11
+ ] ;
Original file line number Diff line number Diff line change 1
1
// should-fail
2
+ const FILTER_CRATE = "std" ;
2
3
const EXPECTED = [
3
4
{
4
5
// Keep this test case identical to `transmute`, except the
@@ -7,7 +8,7 @@ const EXPECTED = [
7
8
'others' : [
8
9
{ 'path' : 'std::intrinsics::simd' , 'name' : 'simd_as' } ,
9
10
{ 'path' : 'std::intrinsics::simd' , 'name' : 'simd_cast' } ,
10
- { 'path' : 'std::intrinsics ' , 'name' : 'transmute' } ,
11
+ { 'path' : 'std::mem ' , 'name' : 'transmute' } ,
11
12
] ,
12
13
} ,
13
14
] ;
Original file line number Diff line number Diff line change
1
+ const FILTER_CRATE = "std" ;
1
2
const EXPECTED = [
2
3
{
3
4
// Keep this test case identical to `transmute-fail`, except the
@@ -6,7 +7,7 @@ const EXPECTED = [
6
7
'others' : [
7
8
{ 'path' : 'std::intrinsics::simd' , 'name' : 'simd_as' } ,
8
9
{ 'path' : 'std::intrinsics::simd' , 'name' : 'simd_cast' } ,
9
- { 'path' : 'std::intrinsics ' , 'name' : 'transmute' } ,
10
+ { 'path' : 'std::mem ' , 'name' : 'transmute' } ,
10
11
] ,
11
12
} ,
12
13
] ;
You can’t perform that action at this time.
0 commit comments