remove some unnecessary lifetimes
This commit is contained in:
parent
05ccc49a44
commit
c39929ce18
1 changed files with 19 additions and 23 deletions
|
@ -71,8 +71,8 @@ pub fn ensure_removed(dcx: &DiagCtxt, path: &Path) {
|
||||||
|
|
||||||
/// Performs the linkage portion of the compilation phase. This will generate all
|
/// Performs the linkage portion of the compilation phase. This will generate all
|
||||||
/// of the requested outputs for this compilation session.
|
/// of the requested outputs for this compilation session.
|
||||||
pub fn link_binary<'a>(
|
pub fn link_binary(
|
||||||
sess: &'a Session,
|
sess: &Session,
|
||||||
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
||||||
codegen_results: &CodegenResults,
|
codegen_results: &CodegenResults,
|
||||||
outputs: &OutputFilenames,
|
outputs: &OutputFilenames,
|
||||||
|
@ -464,9 +464,9 @@ fn link_rlib<'a>(
|
||||||
/// then the CodegenResults value contains one NativeLib instance for each block. However, the
|
/// then the CodegenResults value contains one NativeLib instance for each block. However, the
|
||||||
/// linker appears to expect only a single import library for each library used, so we need to
|
/// linker appears to expect only a single import library for each library used, so we need to
|
||||||
/// collate the symbols together by library name before generating the import libraries.
|
/// collate the symbols together by library name before generating the import libraries.
|
||||||
fn collate_raw_dylibs<'a, 'b>(
|
fn collate_raw_dylibs<'a>(
|
||||||
sess: &'a Session,
|
sess: &Session,
|
||||||
used_libraries: impl IntoIterator<Item = &'b NativeLib>,
|
used_libraries: impl IntoIterator<Item = &'a NativeLib>,
|
||||||
) -> Result<Vec<(String, Vec<DllImport>)>, ErrorGuaranteed> {
|
) -> Result<Vec<(String, Vec<DllImport>)>, ErrorGuaranteed> {
|
||||||
// Use index maps to preserve original order of imports and libraries.
|
// Use index maps to preserve original order of imports and libraries.
|
||||||
let mut dylib_table = FxIndexMap::<String, FxIndexMap<Symbol, &DllImport>>::default();
|
let mut dylib_table = FxIndexMap::<String, FxIndexMap<Symbol, &DllImport>>::default();
|
||||||
|
@ -513,8 +513,8 @@ fn collate_raw_dylibs<'a, 'b>(
|
||||||
///
|
///
|
||||||
/// There's no need to include metadata in a static archive, so ensure to not link in the metadata
|
/// There's no need to include metadata in a static archive, so ensure to not link in the metadata
|
||||||
/// object file (and also don't prepare the archive with a metadata file).
|
/// object file (and also don't prepare the archive with a metadata file).
|
||||||
fn link_staticlib<'a>(
|
fn link_staticlib(
|
||||||
sess: &'a Session,
|
sess: &Session,
|
||||||
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
||||||
codegen_results: &CodegenResults,
|
codegen_results: &CodegenResults,
|
||||||
out_filename: &Path,
|
out_filename: &Path,
|
||||||
|
@ -626,11 +626,7 @@ fn link_staticlib<'a>(
|
||||||
|
|
||||||
/// Use `thorin` (rust implementation of a dwarf packaging utility) to link DWARF objects into a
|
/// Use `thorin` (rust implementation of a dwarf packaging utility) to link DWARF objects into a
|
||||||
/// DWARF package.
|
/// DWARF package.
|
||||||
fn link_dwarf_object<'a>(
|
fn link_dwarf_object(sess: &Session, cg_results: &CodegenResults, executable_out_filename: &Path) {
|
||||||
sess: &'a Session,
|
|
||||||
cg_results: &CodegenResults,
|
|
||||||
executable_out_filename: &Path,
|
|
||||||
) {
|
|
||||||
let mut dwp_out_filename = executable_out_filename.to_path_buf().into_os_string();
|
let mut dwp_out_filename = executable_out_filename.to_path_buf().into_os_string();
|
||||||
dwp_out_filename.push(".dwp");
|
dwp_out_filename.push(".dwp");
|
||||||
debug!(?dwp_out_filename, ?executable_out_filename);
|
debug!(?dwp_out_filename, ?executable_out_filename);
|
||||||
|
@ -734,8 +730,8 @@ fn link_dwarf_object<'a>(
|
||||||
///
|
///
|
||||||
/// This will invoke the system linker/cc to create the resulting file. This links to all upstream
|
/// This will invoke the system linker/cc to create the resulting file. This links to all upstream
|
||||||
/// files as well.
|
/// files as well.
|
||||||
fn link_natively<'a>(
|
fn link_natively(
|
||||||
sess: &'a Session,
|
sess: &Session,
|
||||||
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
||||||
crate_type: CrateType,
|
crate_type: CrateType,
|
||||||
out_filename: &Path,
|
out_filename: &Path,
|
||||||
|
@ -1099,8 +1095,8 @@ fn link_natively<'a>(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn strip_symbols_with_external_utility<'a>(
|
fn strip_symbols_with_external_utility(
|
||||||
sess: &'a Session,
|
sess: &Session,
|
||||||
util: &str,
|
util: &str,
|
||||||
out_filename: &Path,
|
out_filename: &Path,
|
||||||
option: Option<&str>,
|
option: Option<&str>,
|
||||||
|
@ -2108,10 +2104,10 @@ fn add_rpath_args(
|
||||||
/// to the linking process as a whole.
|
/// to the linking process as a whole.
|
||||||
/// Order-independent options may still override each other in order-dependent fashion,
|
/// Order-independent options may still override each other in order-dependent fashion,
|
||||||
/// e.g `--foo=yes --foo=no` may be equivalent to `--foo=no`.
|
/// e.g `--foo=yes --foo=no` may be equivalent to `--foo=no`.
|
||||||
fn linker_with_args<'a>(
|
fn linker_with_args(
|
||||||
path: &Path,
|
path: &Path,
|
||||||
flavor: LinkerFlavor,
|
flavor: LinkerFlavor,
|
||||||
sess: &'a Session,
|
sess: &Session,
|
||||||
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
||||||
crate_type: CrateType,
|
crate_type: CrateType,
|
||||||
tmpdir: &Path,
|
tmpdir: &Path,
|
||||||
|
@ -2643,9 +2639,9 @@ fn add_local_native_libraries(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn add_upstream_rust_crates<'a>(
|
fn add_upstream_rust_crates(
|
||||||
cmd: &mut dyn Linker,
|
cmd: &mut dyn Linker,
|
||||||
sess: &'a Session,
|
sess: &Session,
|
||||||
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
||||||
codegen_results: &CodegenResults,
|
codegen_results: &CodegenResults,
|
||||||
crate_type: CrateType,
|
crate_type: CrateType,
|
||||||
|
@ -2782,7 +2778,7 @@ fn add_upstream_native_libraries(
|
||||||
// file generated by the MSVC linker. See https://github.com/rust-lang/rust/issues/112586.
|
// file generated by the MSVC linker. See https://github.com/rust-lang/rust/issues/112586.
|
||||||
//
|
//
|
||||||
// The returned path will always have `fix_windows_verbatim_for_gcc()` applied to it.
|
// The returned path will always have `fix_windows_verbatim_for_gcc()` applied to it.
|
||||||
fn rehome_sysroot_lib_dir<'a>(sess: &'a Session, lib_dir: &Path) -> PathBuf {
|
fn rehome_sysroot_lib_dir(sess: &Session, lib_dir: &Path) -> PathBuf {
|
||||||
let sysroot_lib_path = sess.target_filesearch(PathKind::All).get_lib_path();
|
let sysroot_lib_path = sess.target_filesearch(PathKind::All).get_lib_path();
|
||||||
let canonical_sysroot_lib_path =
|
let canonical_sysroot_lib_path =
|
||||||
{ try_canonicalize(&sysroot_lib_path).unwrap_or_else(|_| sysroot_lib_path.clone()) };
|
{ try_canonicalize(&sysroot_lib_path).unwrap_or_else(|_| sysroot_lib_path.clone()) };
|
||||||
|
@ -2815,9 +2811,9 @@ fn rehome_sysroot_lib_dir<'a>(sess: &'a Session, lib_dir: &Path) -> PathBuf {
|
||||||
// Note, however, that if we're not doing LTO we can just pass the rlib
|
// Note, however, that if we're not doing LTO we can just pass the rlib
|
||||||
// blindly to the linker (fast) because it's fine if it's not actually
|
// blindly to the linker (fast) because it's fine if it's not actually
|
||||||
// included as we're at the end of the dependency chain.
|
// included as we're at the end of the dependency chain.
|
||||||
fn add_static_crate<'a>(
|
fn add_static_crate(
|
||||||
cmd: &mut dyn Linker,
|
cmd: &mut dyn Linker,
|
||||||
sess: &'a Session,
|
sess: &Session,
|
||||||
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
archive_builder_builder: &dyn ArchiveBuilderBuilder,
|
||||||
codegen_results: &CodegenResults,
|
codegen_results: &CodegenResults,
|
||||||
tmpdir: &Path,
|
tmpdir: &Path,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue