@@ -195,8 +195,6 @@ crate struct SharedContext {
195195 /// Optional path string to be used to load static files on output pages. If not set, uses
196196 /// combinations of `../` to reach the documentation root.
197197 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 ,
200198 /// The fs handle we are working with.
201199 pub fs : DocFS ,
202200 /// The default edition used to parse doctests.
@@ -468,7 +466,6 @@ pub fn run(
468466 resource_suffix,
469467 static_root_path,
470468 generate_search_filter,
471- generate_redirect_pages,
472469 document_private,
473470 ..
474471 } = options;
@@ -536,7 +533,6 @@ pub fn run(
536533 themes,
537534 resource_suffix,
538535 static_root_path,
539- generate_redirect_pages,
540536 fs : DocFS :: new ( & errors) ,
541537 edition,
542538 codes : ErrorCodes :: from ( UnstableFeatures :: from_environment ( ) . is_nightly_build ( ) ) ,
@@ -1556,14 +1552,6 @@ impl Context {
15561552 if !self . render_redirect_pages {
15571553 all. append ( full_path ( self , & item) , & item_type) ;
15581554 }
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- }
15671555 // If the item is a macro, redirect from the old macro URL (with !)
15681556 // to the new one (without).
15691557 if item_type == ItemType :: Macro {
@@ -2586,8 +2574,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
25862574 let name = m. name . as_ref ( ) . unwrap ( ) ;
25872575 let item_type = m. type_ ( ) ;
25882576 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) ;
25912578 render_assoc_item ( w, m, AssocItemLink :: Anchor ( Some ( & id) ) , ItemType :: Impl ) ;
25922579 write ! ( w, "</code>" ) ;
25932580 render_stability_since ( w, m, t) ;
@@ -2972,20 +2959,14 @@ fn item_struct(w: &mut Buffer, cx: &Context, it: &clean::Item, s: &clean::Struct
29722959 ItemType :: StructField ,
29732960 field. name. as_ref( ) . unwrap( )
29742961 ) ) ;
2975- let ns_id = cx. derive_id ( format ! (
2976- "{}.{}" ,
2977- field. name. as_ref( ) . unwrap( ) ,
2978- ItemType :: StructField . name_space( )
2979- ) ) ;
29802962 write ! (
29812963 w,
29822964 "<span id=\" {id}\" class=\" {item_type} small-section-header\" >\
29832965 <a href=\" #{id}\" class=\" anchor field\" ></a>\
2984- <code id= \" {ns_id} \" >{name}: {ty}</code>\
2966+ <code>{name}: {ty}</code>\
29852967 </span>",
29862968 item_type = ItemType :: StructField ,
29872969 id = id,
2988- ns_id = ns_id,
29892970 name = field. name. as_ref( ) . unwrap( ) ,
29902971 ty = ty. print( )
29912972 ) ;
@@ -3103,18 +3084,12 @@ fn item_enum(w: &mut Buffer, cx: &Context, it: &clean::Item, e: &clean::Enum) {
31033084 for variant in & e. variants {
31043085 let id =
31053086 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- ) ) ;
31113087 write ! (
31123088 w,
31133089 "<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}",
31163092 id = id,
3117- ns_id = ns_id,
31183093 name = variant. name. as_ref( ) . unwrap( )
31193094 ) ;
31203095 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) {
31553130 variant. name. as_ref( ) . unwrap( ) ,
31563131 field. name. as_ref( ) . unwrap( )
31573132 ) ) ;
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- ) ) ;
31653133 write ! (
31663134 w,
31673135 "<span id=\" {id}\" class=\" variant small-section-header\" >\
31683136 <a href=\" #{id}\" class=\" anchor field\" ></a>\
3169- <code id='{ns_id}' >{f}: {t}\
3137+ <code>{f}: {t}\
31703138 </code></span>",
31713139 id = id,
3172- ns_id = ns_id,
31733140 f = field. name. as_ref( ) . unwrap( ) ,
31743141 t = ty. print( )
31753142 ) ;
@@ -3661,9 +3628,7 @@ fn render_impl(
36613628 // Only render when the method is not static or we allow static methods
36623629 if render_method_item {
36633630 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) ;
36673632 render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ;
36683633 write ! ( w, "</code>" ) ;
36693634 render_stability_since_raw ( w, item. stable_since ( ) , outer_version) ;
@@ -3679,17 +3644,13 @@ fn render_impl(
36793644 }
36803645 clean:: TypedefItem ( ref tydef, _) => {
36813646 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) ;
36853648 assoc_type ( w, item, & Vec :: new ( ) , Some ( & tydef. type_ ) , link. anchor ( & id) , "" ) ;
36863649 write ! ( w, "</code></h4>" ) ;
36873650 }
36883651 clean:: AssocConstItem ( ref ty, ref default) => {
36893652 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) ;
36933654 assoc_const ( w, item, ty, default. as_ref ( ) , link. anchor ( & id) , "" ) ;
36943655 write ! ( w, "</code>" ) ;
36953656 render_stability_since_raw ( w, item. stable_since ( ) , outer_version) ;
@@ -3704,9 +3665,7 @@ fn render_impl(
37043665 }
37053666 clean:: AssocTypeItem ( ref bounds, ref default) => {
37063667 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) ;
37103669 assoc_type ( w, item, bounds, default. as_ref ( ) , link. anchor ( & id) , "" ) ;
37113670 write ! ( w, "</code></h4>" ) ;
37123671 }
0 commit comments