@@ -195,8 +195,6 @@ crate struct SharedContext {
195
195
/// Optional path string to be used to load static files on output pages. If not set, uses
196
196
/// combinations of `../` to reach the documentation root.
197
197
pub static_root_path : Option < String > ,
198
- /// Option disabled by default to generate files used by RLS and some other tools.
199
- pub generate_redirect_pages : bool ,
200
198
/// The fs handle we are working with.
201
199
pub fs : DocFS ,
202
200
/// The default edition used to parse doctests.
@@ -468,7 +466,6 @@ pub fn run(
468
466
resource_suffix,
469
467
static_root_path,
470
468
generate_search_filter,
471
- generate_redirect_pages,
472
469
document_private,
473
470
..
474
471
} = options;
@@ -536,7 +533,6 @@ pub fn run(
536
533
themes,
537
534
resource_suffix,
538
535
static_root_path,
539
- generate_redirect_pages,
540
536
fs : DocFS :: new ( & errors) ,
541
537
edition,
542
538
codes : ErrorCodes :: from ( UnstableFeatures :: from_environment ( ) . is_nightly_build ( ) ) ,
@@ -1556,14 +1552,6 @@ impl Context {
1556
1552
if !self . render_redirect_pages {
1557
1553
all. append ( full_path ( self , & item) , & item_type) ;
1558
1554
}
1559
- if self . shared . generate_redirect_pages {
1560
- // Redirect from a sane URL using the namespace to Rustdoc's
1561
- // URL for the page.
1562
- let redir_name = format ! ( "{}.{}.html" , name, item_type. name_space( ) ) ;
1563
- let redir_dst = self . dst . join ( redir_name) ;
1564
- let v = layout:: redirect ( file_name) ;
1565
- self . shared . fs . write ( & redir_dst, v. as_bytes ( ) ) ?;
1566
- }
1567
1555
// If the item is a macro, redirect from the old macro URL (with !)
1568
1556
// to the new one (without).
1569
1557
if item_type == ItemType :: Macro {
@@ -2586,8 +2574,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
2586
2574
let name = m. name . as_ref ( ) . unwrap ( ) ;
2587
2575
let item_type = m. type_ ( ) ;
2588
2576
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
2589
- let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
2590
- write ! ( w, "<h3 id='{id}' class='method'><code id='{ns_id}'>" , id = id, ns_id = ns_id) ;
2577
+ write ! ( w, "<h3 id='{id}' class='method'><code>" , id = id) ;
2591
2578
render_assoc_item ( w, m, AssocItemLink :: Anchor ( Some ( & id) ) , ItemType :: Impl ) ;
2592
2579
write ! ( w, "</code>" ) ;
2593
2580
render_stability_since ( w, m, t) ;
@@ -2972,20 +2959,14 @@ fn item_struct(w: &mut Buffer, cx: &Context, it: &clean::Item, s: &clean::Struct
2972
2959
ItemType :: StructField ,
2973
2960
field. name. as_ref( ) . unwrap( )
2974
2961
) ) ;
2975
- let ns_id = cx. derive_id ( format ! (
2976
- "{}.{}" ,
2977
- field. name. as_ref( ) . unwrap( ) ,
2978
- ItemType :: StructField . name_space( )
2979
- ) ) ;
2980
2962
write ! (
2981
2963
w,
2982
2964
"<span id=\" {id}\" class=\" {item_type} small-section-header\" >\
2983
2965
<a href=\" #{id}\" class=\" anchor field\" ></a>\
2984
- <code id= \" {ns_id} \" >{name}: {ty}</code>\
2966
+ <code>{name}: {ty}</code>\
2985
2967
</span>",
2986
2968
item_type = ItemType :: StructField ,
2987
2969
id = id,
2988
- ns_id = ns_id,
2989
2970
name = field. name. as_ref( ) . unwrap( ) ,
2990
2971
ty = ty. print( )
2991
2972
) ;
@@ -3103,18 +3084,12 @@ fn item_enum(w: &mut Buffer, cx: &Context, it: &clean::Item, e: &clean::Enum) {
3103
3084
for variant in & e. variants {
3104
3085
let id =
3105
3086
cx. derive_id ( format ! ( "{}.{}" , ItemType :: Variant , variant. name. as_ref( ) . unwrap( ) ) ) ;
3106
- let ns_id = cx. derive_id ( format ! (
3107
- "{}.{}" ,
3108
- variant. name. as_ref( ) . unwrap( ) ,
3109
- ItemType :: Variant . name_space( )
3110
- ) ) ;
3111
3087
write ! (
3112
3088
w,
3113
3089
"<div id=\" {id}\" class=\" variant small-section-header\" >\
3114
- <a href=\" #{id}\" class=\" anchor field\" ></a>\
3115
- <code id='{ns_id}' >{name}",
3090
+ <a href=\" #{id}\" class=\" anchor field\" ></a>\
3091
+ <code>{name}",
3116
3092
id = id,
3117
- ns_id = ns_id,
3118
3093
name = variant. name. as_ref( ) . unwrap( )
3119
3094
) ;
3120
3095
if let clean:: VariantItem ( ref var) = variant. inner {
@@ -3155,21 +3130,13 @@ fn item_enum(w: &mut Buffer, cx: &Context, it: &clean::Item, e: &clean::Enum) {
3155
3130
variant. name. as_ref( ) . unwrap( ) ,
3156
3131
field. name. as_ref( ) . unwrap( )
3157
3132
) ) ;
3158
- let ns_id = cx. derive_id ( format ! (
3159
- "{}.{}.{}.{}" ,
3160
- variant. name. as_ref( ) . unwrap( ) ,
3161
- ItemType :: Variant . name_space( ) ,
3162
- field. name. as_ref( ) . unwrap( ) ,
3163
- ItemType :: StructField . name_space( )
3164
- ) ) ;
3165
3133
write ! (
3166
3134
w,
3167
3135
"<span id=\" {id}\" class=\" variant small-section-header\" >\
3168
3136
<a href=\" #{id}\" class=\" anchor field\" ></a>\
3169
- <code id='{ns_id}' >{f}: {t}\
3137
+ <code>{f}: {t}\
3170
3138
</code></span>",
3171
3139
id = id,
3172
- ns_id = ns_id,
3173
3140
f = field. name. as_ref( ) . unwrap( ) ,
3174
3141
t = ty. print( )
3175
3142
) ;
@@ -3661,9 +3628,7 @@ fn render_impl(
3661
3628
// Only render when the method is not static or we allow static methods
3662
3629
if render_method_item {
3663
3630
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
3664
- let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
3665
- write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3666
- write ! ( w, "<code id='{}'>" , ns_id) ;
3631
+ write ! ( w, "<h4 id='{}' class=\" {}{}\" ><code>" , id, item_type, extra_class) ;
3667
3632
render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ;
3668
3633
write ! ( w, "</code>" ) ;
3669
3634
render_stability_since_raw ( w, item. stable_since ( ) , outer_version) ;
@@ -3679,17 +3644,13 @@ fn render_impl(
3679
3644
}
3680
3645
clean:: TypedefItem ( ref tydef, _) => {
3681
3646
let id = cx. derive_id ( format ! ( "{}.{}" , ItemType :: AssocType , name) ) ;
3682
- let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
3683
- write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3684
- write ! ( w, "<code id='{}'>" , ns_id) ;
3647
+ write ! ( w, "<h4 id='{}' class=\" {}{}\" ><code>" , id, item_type, extra_class) ;
3685
3648
assoc_type ( w, item, & Vec :: new ( ) , Some ( & tydef. type_ ) , link. anchor ( & id) , "" ) ;
3686
3649
write ! ( w, "</code></h4>" ) ;
3687
3650
}
3688
3651
clean:: AssocConstItem ( ref ty, ref default) => {
3689
3652
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
3690
- let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
3691
- write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3692
- write ! ( w, "<code id='{}'>" , ns_id) ;
3653
+ write ! ( w, "<h4 id='{}' class=\" {}{}\" ><code>" , id, item_type, extra_class) ;
3693
3654
assoc_const ( w, item, ty, default. as_ref ( ) , link. anchor ( & id) , "" ) ;
3694
3655
write ! ( w, "</code>" ) ;
3695
3656
render_stability_since_raw ( w, item. stable_since ( ) , outer_version) ;
@@ -3704,9 +3665,7 @@ fn render_impl(
3704
3665
}
3705
3666
clean:: AssocTypeItem ( ref bounds, ref default) => {
3706
3667
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
3707
- let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
3708
- write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3709
- write ! ( w, "<code id='{}'>" , ns_id) ;
3668
+ write ! ( w, "<h4 id='{}' class=\" {}{}\" ><code>" , id, item_type, extra_class) ;
3710
3669
assoc_type ( w, item, bounds, default. as_ref ( ) , link. anchor ( & id) , "" ) ;
3711
3670
write ! ( w, "</code></h4>" ) ;
3712
3671
}
0 commit comments