File tree 3 files changed +8
-5
lines changed
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 {
117
117
#[ derive( Clone , Debug ) ]
118
118
crate struct Crate {
119
119
crate name : Symbol ,
120
- crate src : FileName ,
121
120
crate module : Item ,
122
121
crate externs : Vec < ExternalCrate > ,
123
122
crate primitives : ThinVec < ( DefId , PrimitiveType ) > ,
@@ -128,7 +127,13 @@ crate struct Crate {
128
127
129
128
// `Crate` is frequently moved by-value. Make sure it doesn't unintentionally get bigger.
130
129
#[ 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
+ }
132
137
133
138
/// This struct is used to wrap additional information added by rustdoc on a `trait` item.
134
139
#[ derive( Clone , Debug ) ]
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
57
57
}
58
58
59
59
let local_crate = ExternalCrate { crate_num : LOCAL_CRATE } ;
60
- let src = local_crate. src ( cx. tcx ) ;
61
60
let name = local_crate. name ( cx. tcx ) ;
62
61
let primitives = local_crate. primitives ( cx. tcx ) ;
63
62
let keywords = local_crate. keywords ( cx. tcx ) ;
@@ -81,7 +80,6 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
81
80
82
81
Crate {
83
82
name,
84
- src,
85
83
module,
86
84
externs,
87
85
primitives,
Original file line number Diff line number Diff line change @@ -405,7 +405,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
405
405
..
406
406
} = options;
407
407
408
- let src_root = match krate. src {
408
+ let src_root = match krate. src ( tcx ) {
409
409
FileName :: Real ( ref p) => match p. local_path_if_available ( ) . parent ( ) {
410
410
Some ( p) => p. to_path_buf ( ) ,
411
411
None => PathBuf :: new ( ) ,
You can’t perform that action at this time.
0 commit comments