File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,6 @@ crate struct SharedContext<'tcx> {
111
111
crate static_root_path : Option < String > ,
112
112
/// The fs handle we are working with.
113
113
crate fs : DocFS ,
114
- /// The default edition used to parse doctests.
115
- crate edition : Edition ,
116
114
pub ( super ) codes : ErrorCodes ,
117
115
pub ( super ) playground : Option < markdown:: Playground > ,
118
116
all : RefCell < AllTypes > ,
@@ -141,6 +139,10 @@ impl SharedContext<'_> {
141
139
crate fn maybe_collapsed_doc_value < ' a > ( & self , item : & ' a clean:: Item ) -> Option < String > {
142
140
if self . collapsed { item. collapsed_doc_value ( ) } else { item. doc_value ( ) }
143
141
}
142
+
143
+ crate fn edition ( & self ) -> Edition {
144
+ self . tcx . sess . edition ( )
145
+ }
144
146
}
145
147
146
148
impl < ' tcx > Context < ' tcx > {
@@ -434,7 +436,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
434
436
resource_suffix,
435
437
static_root_path,
436
438
fs : DocFS :: new ( sender) ,
437
- edition : tcx. sess . edition ( ) ,
438
439
codes : ErrorCodes :: from ( unstable_features. is_nightly_build ( ) ) ,
439
440
playground,
440
441
all : RefCell :: new ( AllTypes :: new ( ) ) ,
Original file line number Diff line number Diff line change @@ -530,7 +530,7 @@ fn render_markdown(
530
530
& links,
531
531
& mut ids,
532
532
cx. shared. codes,
533
- cx. shared. edition,
533
+ cx. shared. edition( ) ,
534
534
& cx. shared. playground
535
535
)
536
536
. into_string( )
@@ -660,7 +660,7 @@ fn short_item_info(
660
660
& note,
661
661
& mut ids,
662
662
error_codes,
663
- cx. shared . edition ,
663
+ cx. shared . edition ( ) ,
664
664
& cx. shared . playground ,
665
665
) ;
666
666
message. push_str ( & format ! ( ": {}" , html. into_string( ) ) ) ;
@@ -702,7 +702,7 @@ fn short_item_info(
702
702
& unstable_reason. as_str( ) ,
703
703
& mut ids,
704
704
error_codes,
705
- cx. shared. edition,
705
+ cx. shared. edition( ) ,
706
706
& cx. shared. playground,
707
707
)
708
708
. into_string( )
@@ -1358,7 +1358,7 @@ fn render_impl(
1358
1358
& i. impl_item. links( cx) ,
1359
1359
& mut ids,
1360
1360
cx. shared. codes,
1361
- cx. shared. edition,
1361
+ cx. shared. edition( ) ,
1362
1362
& cx. shared. playground
1363
1363
)
1364
1364
. into_string( )
Original file line number Diff line number Diff line change @@ -425,7 +425,7 @@ pub(super) fn write_shared(
425
425
md_opts. output = cx. dst . clone ( ) ;
426
426
md_opts. external_html = ( * cx. shared ) . layout . external_html . clone ( ) ;
427
427
428
- crate :: markdown:: render ( & index_page, md_opts, cx. shared . edition )
428
+ crate :: markdown:: render ( & index_page, md_opts, cx. shared . edition ( ) )
429
429
. map_err ( |e| Error :: new ( e, & index_page) ) ?;
430
430
} else {
431
431
let dst = cx. dst . join ( "index.html" ) ;
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ impl SourceCollector<'_, 'tcx> {
129
129
& self . scx . layout ,
130
130
& page,
131
131
"" ,
132
- |buf : & mut _ | print_src ( buf, contents, self . scx . edition ) ,
132
+ |buf : & mut _ | print_src ( buf, contents, self . scx . edition ( ) ) ,
133
133
& self . scx . style_files ,
134
134
) ;
135
135
self . scx . fs . write ( & cur, v. as_bytes ( ) ) ?;
You can’t perform that action at this time.
0 commit comments