File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,6 @@ impl From<DefId> for ItemId {
117117#[ derive( Clone , Debug ) ]
118118crate struct Crate {
119119 crate name : Symbol ,
120- crate src : FileName ,
121120 crate module : Item ,
122121 crate externs : Vec < ExternalCrate > ,
123122 crate primitives : ThinVec < ( DefId , PrimitiveType ) > ,
@@ -128,7 +127,13 @@ crate struct Crate {
128127
129128// `Crate` is frequently moved by-value. Make sure it doesn't unintentionally get bigger.
130129#[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
131- rustc_data_structures:: static_assert_size!( Crate , 168 ) ;
130+ rustc_data_structures:: static_assert_size!( Crate , 104 ) ;
131+
132+ impl Crate {
133+ crate fn src ( & self , tcx : TyCtxt < ' _ > ) -> FileName {
134+ ExternalCrate :: LOCAL . src ( tcx)
135+ }
136+ }
132137
133138/// This struct is used to wrap additional information added by rustdoc on a `trait` item.
134139#[ derive( Clone , Debug ) ]
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
5757 }
5858
5959 let local_crate = ExternalCrate { crate_num : LOCAL_CRATE } ;
60- let src = local_crate. src ( cx. tcx ) ;
6160 let name = local_crate. name ( cx. tcx ) ;
6261 let primitives = local_crate. primitives ( cx. tcx ) ;
6362 let keywords = local_crate. keywords ( cx. tcx ) ;
@@ -81,7 +80,6 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
8180
8281 Crate {
8382 name,
84- src,
8583 module,
8684 externs,
8785 primitives,
Original file line number Diff line number Diff line change @@ -405,7 +405,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
405405 ..
406406 } = options;
407407
408- let src_root = match krate. src {
408+ let src_root = match krate. src ( tcx ) {
409409 FileName :: Real ( ref p) => match p. local_path_if_available ( ) . parent ( ) {
410410 Some ( p) => p. to_path_buf ( ) ,
411411 None => PathBuf :: new ( ) ,
You can’t perform that action at this time.
0 commit comments