@@ -164,8 +164,6 @@ struct Context {
164
164
/// publicly reused items to redirect to the right location.
165
165
pub render_redirect_pages : bool ,
166
166
pub codes : ErrorCodes ,
167
- /// The default edition used to parse doctests.
168
- pub edition : Edition ,
169
167
/// The map used to ensure all generated 'id=' attributes are unique.
170
168
id_map : Rc < RefCell < IdMap > > ,
171
169
pub shared : Arc < SharedContext > ,
@@ -208,6 +206,8 @@ crate struct SharedContext {
208
206
pub generate_redirect_pages : bool ,
209
207
/// The fs handle we are working with.
210
208
pub fs : DocFS ,
209
+ /// The default edition used to parse doctests.
210
+ pub edition : Edition ,
211
211
}
212
212
213
213
impl SharedContext {
@@ -539,6 +539,7 @@ pub fn run(mut krate: clean::Crate,
539
539
static_root_path,
540
540
generate_redirect_pages,
541
541
fs : DocFS :: new ( & errors) ,
542
+ edition,
542
543
} ;
543
544
544
545
// If user passed in `--playground-url` arg, we fill in crate name here
@@ -585,7 +586,6 @@ pub fn run(mut krate: clean::Crate,
585
586
dst,
586
587
render_redirect_pages : false ,
587
588
codes : ErrorCodes :: from ( UnstableFeatures :: from_environment ( ) . is_nightly_build ( ) ) ,
588
- edition,
589
589
id_map : Rc :: new ( RefCell :: new ( id_map) ) ,
590
590
shared : Arc :: new ( scx) ,
591
591
playground,
@@ -1134,7 +1134,7 @@ themePicker.onblur = handleThemeButtonsBlur;
1134
1134
md_opts. output = cx. dst . clone ( ) ;
1135
1135
md_opts. external_html = ( * cx. shared ) . layout . external_html . clone ( ) ;
1136
1136
1137
- crate :: markdown:: render ( index_page, md_opts, diag, cx. edition ) ;
1137
+ crate :: markdown:: render ( index_page, md_opts, diag, cx. shared . edition ) ;
1138
1138
} else {
1139
1139
let dst = cx. dst . join ( "index.html" ) ;
1140
1140
let page = layout:: Page {
@@ -2353,7 +2353,7 @@ fn render_markdown(
2353
2353
if is_hidden { " hidden" } else { "" } ,
2354
2354
prefix,
2355
2355
Markdown ( md_text, & links, & mut ids,
2356
- cx. codes, cx. edition, & cx. playground) . to_string( ) )
2356
+ cx. codes, cx. shared . edition, & cx. playground) . to_string( ) )
2357
2357
}
2358
2358
2359
2359
fn document_short (
@@ -2710,7 +2710,8 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2710
2710
2711
2711
if let Some ( note) = note {
2712
2712
let mut ids = cx. id_map . borrow_mut ( ) ;
2713
- let html = MarkdownHtml ( & note, & mut ids, error_codes, cx. edition , & cx. playground ) ;
2713
+ let html = MarkdownHtml (
2714
+ & note, & mut ids, error_codes, cx. shared . edition , & cx. playground ) ;
2714
2715
message. push_str ( & format ! ( ": {}" , html. to_string( ) ) ) ;
2715
2716
}
2716
2717
stability. push ( format ! ( "<div class='stab deprecated'>{}</div>" , message) ) ;
@@ -2763,7 +2764,7 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2763
2764
& unstable_reason,
2764
2765
& mut ids,
2765
2766
error_codes,
2766
- cx. edition,
2767
+ cx. shared . edition,
2767
2768
& cx. playground,
2768
2769
) . to_string( )
2769
2770
) ;
@@ -3960,7 +3961,7 @@ fn render_impl(w: &mut Buffer, cx: &Context, i: &Impl, link: AssocItemLink<'_>,
3960
3961
let mut ids = cx. id_map . borrow_mut ( ) ;
3961
3962
write ! ( w, "<div class='docblock'>{}</div>" ,
3962
3963
Markdown ( & * dox, & i. impl_item. links( ) , & mut ids,
3963
- cx. codes, cx. edition, & cx. playground) . to_string( ) ) ;
3964
+ cx. codes, cx. shared . edition, & cx. playground) . to_string( ) ) ;
3964
3965
}
3965
3966
}
3966
3967
0 commit comments