diff options
| author | bors <bors@rust-lang.org> | 2024-02-27 03:27:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-27 03:27:48 +0000 |
| commit | 91cae1dcdcf1a31bd8a92e4a63793d65cfe289bb (patch) | |
| tree | 3d8cfcc464a8a7fdb1f9cd3d4fe36d24796d6329 /compiler/rustc_codegen_ssa | |
| parent | 71ffdf7ff7ac6df5f9f64de7e780b8345797e8a0 (diff) | |
| parent | 0c082b7fa918be945712f8510ad2f9135cf26748 (diff) | |
| download | rust-91cae1dcdcf1a31bd8a92e4a63793d65cfe289bb.tar.gz rust-91cae1dcdcf1a31bd8a92e4a63793d65cfe289bb.zip | |
Auto merge of #121635 - 823984418:remove_archive_builder_lifetime_a, r=nnethercote
Remove useless lifetime of ArchiveBuilder
`trait ArchiveBuilder<'a>` has a seemingly useless lifetime a, so I remove it. If this is intentional, please reject this PR.
```rust
pub trait ArchiveBuilder<'a> {
fn add_file(&mut self, path: &Path);
fn add_archive(
&mut self,
archive: &Path,
skip: Box<dyn FnMut(&str) -> bool + 'static>,
) -> io::Result<()>;
fn build(self: Box<Self>, output: &Path) -> bool;
}
```
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/archive.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs index 0dadd047c9a..22b58c13949 100644 --- a/compiler/rustc_codegen_ssa/src/back/archive.rs +++ b/compiler/rustc_codegen_ssa/src/back/archive.rs @@ -21,7 +21,7 @@ use std::path::{Path, PathBuf}; pub use crate::errors::{ArchiveBuildFailure, ExtractBundledLibsError, UnknownArchiveKind}; pub trait ArchiveBuilderBuilder { - fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box<dyn ArchiveBuilder<'a> + 'a>; + fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box<dyn ArchiveBuilder + 'a>; /// Creates a DLL Import Library <https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-creation#creating-an-import-library>. /// and returns the path on disk to that import library. @@ -74,7 +74,7 @@ pub trait ArchiveBuilderBuilder { } } -pub trait ArchiveBuilder<'a> { +pub trait ArchiveBuilder { fn add_file(&mut self, path: &Path); fn add_archive( @@ -167,7 +167,7 @@ pub fn try_extract_macho_fat_archive( } } -impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> { +impl<'a> ArchiveBuilder for ArArchiveBuilder<'a> { fn add_archive( &mut self, archive_path: &Path, diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 1ad0dec0640..e4a050dcfc9 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -308,7 +308,7 @@ fn link_rlib<'a>( codegen_results: &CodegenResults, flavor: RlibFlavor, tmpdir: &MaybeTempDir, -) -> Result<Box<dyn ArchiveBuilder<'a> + 'a>, ErrorGuaranteed> { +) -> Result<Box<dyn ArchiveBuilder + 'a>, ErrorGuaranteed> { let lib_search_paths = archive_search_paths(sess); let mut ab = archive_builder_builder.new_archive_builder(sess); |
