@@ -82,15 +82,15 @@ pub struct CompilationFiles<'a, 'cfg> {
82
82
export_dir : Option < PathBuf > ,
83
83
/// The root targets requested by the user on the command line (does not
84
84
/// include dependencies).
85
- roots : Vec < Unit < ' a > > ,
85
+ roots : Vec < Unit > ,
86
86
ws : & ' a Workspace < ' cfg > ,
87
87
/// Metadata hash to use for each unit.
88
88
///
89
89
/// `None` if the unit should not use a metadata data hash (like rustdoc,
90
90
/// or some dylibs).
91
- metas : HashMap < Unit < ' a > , Option < Metadata > > ,
91
+ metas : HashMap < Unit , Option < Metadata > > ,
92
92
/// For each Unit, a list all files produced.
93
- outputs : HashMap < Unit < ' a > , LazyCell < Arc < Vec < OutputFile > > > > ,
93
+ outputs : HashMap < Unit , LazyCell < Arc < Vec < OutputFile > > > > ,
94
94
}
95
95
96
96
/// Info about a single file emitted by the compiler.
@@ -158,20 +158,20 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
158
158
///
159
159
/// Returns `None` if the unit should not use a metadata data hash (like
160
160
/// rustdoc, or some dylibs).
161
- pub fn metadata ( & self , unit : & Unit < ' a > ) -> Option < Metadata > {
161
+ pub fn metadata ( & self , unit : & Unit ) -> Option < Metadata > {
162
162
self . metas [ unit]
163
163
}
164
164
165
165
/// Gets the short hash based only on the `PackageId`.
166
166
/// Used for the metadata when `metadata` returns `None`.
167
- pub fn target_short_hash ( & self , unit : & Unit < ' _ > ) -> String {
167
+ pub fn target_short_hash ( & self , unit : & Unit ) -> String {
168
168
let hashable = unit. pkg . package_id ( ) . stable_hash ( self . ws . root ( ) ) ;
169
169
util:: short_hash ( & hashable)
170
170
}
171
171
172
172
/// Returns the appropriate output directory for the specified package and
173
173
/// target.
174
- pub fn out_dir ( & self , unit : & Unit < ' a > ) -> PathBuf {
174
+ pub fn out_dir ( & self , unit : & Unit ) -> PathBuf {
175
175
if unit. mode . is_doc ( ) {
176
176
self . layout ( unit. kind ) . doc ( ) . to_path_buf ( )
177
177
} else if unit. mode . is_doc_test ( ) {
@@ -191,7 +191,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
191
191
}
192
192
193
193
/// Directory name to use for a package in the form `NAME-HASH`.
194
- pub fn pkg_dir ( & self , unit : & Unit < ' a > ) -> String {
194
+ pub fn pkg_dir ( & self , unit : & Unit ) -> String {
195
195
let name = unit. pkg . package_id ( ) . name ( ) ;
196
196
match self . metas [ unit] {
197
197
Some ( ref meta) => format ! ( "{}-{}" , name, meta) ,
@@ -211,24 +211,24 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
211
211
212
212
/// Returns the directories where Rust crate dependencies are found for the
213
213
/// specified unit.
214
- pub fn deps_dir ( & self , unit : & Unit < ' _ > ) -> & Path {
214
+ pub fn deps_dir ( & self , unit : & Unit ) -> & Path {
215
215
self . layout ( unit. kind ) . deps ( )
216
216
}
217
217
218
218
/// Directory where the fingerprint for the given unit should go.
219
- pub fn fingerprint_dir ( & self , unit : & Unit < ' a > ) -> PathBuf {
219
+ pub fn fingerprint_dir ( & self , unit : & Unit ) -> PathBuf {
220
220
let dir = self . pkg_dir ( unit) ;
221
221
self . layout ( unit. kind ) . fingerprint ( ) . join ( dir)
222
222
}
223
223
224
224
/// Path where compiler output is cached.
225
- pub fn message_cache_path ( & self , unit : & Unit < ' a > ) -> PathBuf {
225
+ pub fn message_cache_path ( & self , unit : & Unit ) -> PathBuf {
226
226
self . fingerprint_dir ( unit) . join ( "output" )
227
227
}
228
228
229
229
/// Returns the directory where a compiled build script is stored.
230
230
/// `/path/to/target/{debug,release}/build/PKG-HASH`
231
- pub fn build_script_dir ( & self , unit : & Unit < ' a > ) -> PathBuf {
231
+ pub fn build_script_dir ( & self , unit : & Unit ) -> PathBuf {
232
232
assert ! ( unit. target. is_custom_build( ) ) ;
233
233
assert ! ( !unit. mode. is_run_custom_build( ) ) ;
234
234
assert ! ( self . metas. contains_key( unit) ) ;
@@ -239,7 +239,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
239
239
/// Returns the directory where information about running a build script
240
240
/// is stored.
241
241
/// `/path/to/target/{debug,release}/build/PKG-HASH`
242
- pub fn build_script_run_dir ( & self , unit : & Unit < ' a > ) -> PathBuf {
242
+ pub fn build_script_run_dir ( & self , unit : & Unit ) -> PathBuf {
243
243
assert ! ( unit. target. is_custom_build( ) ) ;
244
244
assert ! ( unit. mode. is_run_custom_build( ) ) ;
245
245
let dir = self . pkg_dir ( unit) ;
@@ -248,12 +248,12 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
248
248
249
249
/// Returns the "OUT_DIR" directory for running a build script.
250
250
/// `/path/to/target/{debug,release}/build/PKG-HASH/out`
251
- pub fn build_script_out_dir ( & self , unit : & Unit < ' a > ) -> PathBuf {
251
+ pub fn build_script_out_dir ( & self , unit : & Unit ) -> PathBuf {
252
252
self . build_script_run_dir ( unit) . join ( "out" )
253
253
}
254
254
255
255
/// Returns the file stem for a given target/profile combo (with metadata).
256
- pub fn file_stem ( & self , unit : & Unit < ' a > ) -> String {
256
+ pub fn file_stem ( & self , unit : & Unit ) -> String {
257
257
match self . metas [ unit] {
258
258
Some ( ref metadata) => format ! ( "{}-{}" , unit. target. crate_name( ) , metadata) ,
259
259
None => self . bin_stem ( unit) ,
@@ -292,7 +292,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
292
292
/// Returns the filenames that the given unit will generate.
293
293
pub ( super ) fn outputs (
294
294
& self ,
295
- unit : & Unit < ' a > ,
295
+ unit : & Unit ,
296
296
bcx : & BuildContext < ' a , ' cfg > ,
297
297
) -> CargoResult < Arc < Vec < OutputFile > > > {
298
298
self . outputs [ unit]
@@ -301,7 +301,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
301
301
}
302
302
303
303
/// Returns the bin filename for a given target, without extension and metadata.
304
- fn bin_stem ( & self , unit : & Unit < ' _ > ) -> String {
304
+ fn bin_stem ( & self , unit : & Unit ) -> String {
305
305
if unit. target . allows_dashes ( ) {
306
306
unit. target . name ( ) . to_string ( )
307
307
} else {
@@ -322,7 +322,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
322
322
///
323
323
/// Returns an `Option` because in some cases we don't want to link
324
324
/// (eg a dependent lib).
325
- fn link_stem ( & self , unit : & Unit < ' a > ) -> Option < ( PathBuf , String ) > {
325
+ fn link_stem ( & self , unit : & Unit ) -> Option < ( PathBuf , String ) > {
326
326
let out_dir = self . out_dir ( unit) ;
327
327
let bin_stem = self . bin_stem ( unit) ; // Stem without metadata.
328
328
let file_stem = self . file_stem ( unit) ; // Stem with metadata.
@@ -355,7 +355,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
355
355
356
356
fn calc_outputs (
357
357
& self ,
358
- unit : & Unit < ' a > ,
358
+ unit : & Unit ,
359
359
bcx : & BuildContext < ' a , ' cfg > ,
360
360
) -> CargoResult < Arc < Vec < OutputFile > > > {
361
361
let ret = match unit. mode {
@@ -405,7 +405,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
405
405
406
406
fn calc_outputs_rustc (
407
407
& self ,
408
- unit : & Unit < ' a > ,
408
+ unit : & Unit ,
409
409
bcx : & BuildContext < ' a , ' cfg > ,
410
410
) -> CargoResult < Vec < OutputFile > > {
411
411
let mut ret = Vec :: new ( ) ;
@@ -519,10 +519,10 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
519
519
}
520
520
}
521
521
522
- fn metadata_of < ' a , ' cfg > (
523
- unit : & Unit < ' a > ,
524
- cx : & Context < ' a , ' cfg > ,
525
- metas : & mut HashMap < Unit < ' a > , Option < Metadata > > ,
522
+ fn metadata_of (
523
+ unit : & Unit ,
524
+ cx : & Context < ' _ , ' _ > ,
525
+ metas : & mut HashMap < Unit , Option < Metadata > > ,
526
526
) -> Option < Metadata > {
527
527
if !metas. contains_key ( unit) {
528
528
let meta = compute_metadata ( unit, cx, metas) ;
@@ -534,10 +534,10 @@ fn metadata_of<'a, 'cfg>(
534
534
metas[ unit]
535
535
}
536
536
537
- fn compute_metadata < ' a , ' cfg > (
538
- unit : & Unit < ' a > ,
539
- cx : & Context < ' a , ' cfg > ,
540
- metas : & mut HashMap < Unit < ' a > , Option < Metadata > > ,
537
+ fn compute_metadata (
538
+ unit : & Unit ,
539
+ cx : & Context < ' _ , ' _ > ,
540
+ metas : & mut HashMap < Unit , Option < Metadata > > ,
541
541
) -> Option < Metadata > {
542
542
if unit. mode . is_doc_test ( ) {
543
543
// Doc tests do not have metadata.
0 commit comments