@@ -82,15 +82,15 @@ pub struct CompilationFiles<'a, 'cfg> {
8282 export_dir : Option < PathBuf > ,
8383 /// The root targets requested by the user on the command line (does not
8484 /// include dependencies).
85- roots : Vec < Unit < ' a > > ,
85+ roots : Vec < Unit > ,
8686 ws : & ' a Workspace < ' cfg > ,
8787 /// Metadata hash to use for each unit.
8888 ///
8989 /// `None` if the unit should not use a metadata data hash (like rustdoc,
9090 /// or some dylibs).
91- metas : HashMap < Unit < ' a > , Option < Metadata > > ,
91+ metas : HashMap < Unit , Option < Metadata > > ,
9292 /// 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 > > > > ,
9494}
9595
9696/// Info about a single file emitted by the compiler.
@@ -158,20 +158,20 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
158158 ///
159159 /// Returns `None` if the unit should not use a metadata data hash (like
160160 /// rustdoc, or some dylibs).
161- pub fn metadata ( & self , unit : & Unit < ' a > ) -> Option < Metadata > {
161+ pub fn metadata ( & self , unit : & Unit ) -> Option < Metadata > {
162162 self . metas [ unit]
163163 }
164164
165165 /// Gets the short hash based only on the `PackageId`.
166166 /// 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 {
168168 let hashable = unit. pkg . package_id ( ) . stable_hash ( self . ws . root ( ) ) ;
169169 util:: short_hash ( & hashable)
170170 }
171171
172172 /// Returns the appropriate output directory for the specified package and
173173 /// target.
174- pub fn out_dir ( & self , unit : & Unit < ' a > ) -> PathBuf {
174+ pub fn out_dir ( & self , unit : & Unit ) -> PathBuf {
175175 if unit. mode . is_doc ( ) {
176176 self . layout ( unit. kind ) . doc ( ) . to_path_buf ( )
177177 } else if unit. mode . is_doc_test ( ) {
@@ -191,7 +191,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
191191 }
192192
193193 /// 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 {
195195 let name = unit. pkg . package_id ( ) . name ( ) ;
196196 match self . metas [ unit] {
197197 Some ( ref meta) => format ! ( "{}-{}" , name, meta) ,
@@ -211,24 +211,24 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
211211
212212 /// Returns the directories where Rust crate dependencies are found for the
213213 /// specified unit.
214- pub fn deps_dir ( & self , unit : & Unit < ' _ > ) -> & Path {
214+ pub fn deps_dir ( & self , unit : & Unit ) -> & Path {
215215 self . layout ( unit. kind ) . deps ( )
216216 }
217217
218218 /// 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 {
220220 let dir = self . pkg_dir ( unit) ;
221221 self . layout ( unit. kind ) . fingerprint ( ) . join ( dir)
222222 }
223223
224224 /// 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 {
226226 self . fingerprint_dir ( unit) . join ( "output" )
227227 }
228228
229229 /// Returns the directory where a compiled build script is stored.
230230 /// `/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 {
232232 assert ! ( unit. target. is_custom_build( ) ) ;
233233 assert ! ( !unit. mode. is_run_custom_build( ) ) ;
234234 assert ! ( self . metas. contains_key( unit) ) ;
@@ -239,7 +239,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
239239 /// Returns the directory where information about running a build script
240240 /// is stored.
241241 /// `/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 {
243243 assert ! ( unit. target. is_custom_build( ) ) ;
244244 assert ! ( unit. mode. is_run_custom_build( ) ) ;
245245 let dir = self . pkg_dir ( unit) ;
@@ -248,12 +248,12 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
248248
249249 /// Returns the "OUT_DIR" directory for running a build script.
250250 /// `/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 {
252252 self . build_script_run_dir ( unit) . join ( "out" )
253253 }
254254
255255 /// 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 {
257257 match self . metas [ unit] {
258258 Some ( ref metadata) => format ! ( "{}-{}" , unit. target. crate_name( ) , metadata) ,
259259 None => self . bin_stem ( unit) ,
@@ -292,7 +292,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
292292 /// Returns the filenames that the given unit will generate.
293293 pub ( super ) fn outputs (
294294 & self ,
295- unit : & Unit < ' a > ,
295+ unit : & Unit ,
296296 bcx : & BuildContext < ' a , ' cfg > ,
297297 ) -> CargoResult < Arc < Vec < OutputFile > > > {
298298 self . outputs [ unit]
@@ -301,7 +301,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
301301 }
302302
303303 /// 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 {
305305 if unit. target . allows_dashes ( ) {
306306 unit. target . name ( ) . to_string ( )
307307 } else {
@@ -322,7 +322,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
322322 ///
323323 /// Returns an `Option` because in some cases we don't want to link
324324 /// (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 ) > {
326326 let out_dir = self . out_dir ( unit) ;
327327 let bin_stem = self . bin_stem ( unit) ; // Stem without metadata.
328328 let file_stem = self . file_stem ( unit) ; // Stem with metadata.
@@ -355,7 +355,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
355355
356356 fn calc_outputs (
357357 & self ,
358- unit : & Unit < ' a > ,
358+ unit : & Unit ,
359359 bcx : & BuildContext < ' a , ' cfg > ,
360360 ) -> CargoResult < Arc < Vec < OutputFile > > > {
361361 let ret = match unit. mode {
@@ -405,7 +405,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
405405
406406 fn calc_outputs_rustc (
407407 & self ,
408- unit : & Unit < ' a > ,
408+ unit : & Unit ,
409409 bcx : & BuildContext < ' a , ' cfg > ,
410410 ) -> CargoResult < Vec < OutputFile > > {
411411 let mut ret = Vec :: new ( ) ;
@@ -519,10 +519,10 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
519519 }
520520}
521521
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 > > ,
526526) -> Option < Metadata > {
527527 if !metas. contains_key ( unit) {
528528 let meta = compute_metadata ( unit, cx, metas) ;
@@ -534,10 +534,10 @@ fn metadata_of<'a, 'cfg>(
534534 metas[ unit]
535535}
536536
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 > > ,
541541) -> Option < Metadata > {
542542 if unit. mode . is_doc_test ( ) {
543543 // Doc tests do not have metadata.
0 commit comments