diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-12-14 03:54:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-14 03:54:35 +0100 |
| commit | 87bbbcd1bbdd348d2068dbf5683eb7fbfb908079 (patch) | |
| tree | a442a5321679f806e0bf4fc70b29f17e809df35e /compiler/rustc_metadata | |
| parent | 34e607594b41942903cce31050d1b6b2b8ca948c (diff) | |
| parent | 3198496385cd8fdd89818e0bf14bacd8db6292d9 (diff) | |
| download | rust-87bbbcd1bbdd348d2068dbf5683eb7fbfb908079.tar.gz rust-87bbbcd1bbdd348d2068dbf5683eb7fbfb908079.zip | |
Rollup merge of #134251 - bjorn3:various_cleanups2, r=oli-obk
A bunch of cleanups (part 2) Just like https://github.com/rust-lang/rust/pull/133567 these were all found while looking at the respective code, but are not blocking any other changes I want to make in the short term.
Diffstat (limited to 'compiler/rustc_metadata')
| -rw-r--r-- | compiler/rustc_metadata/src/dependency_format.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/encoder.rs | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_metadata/src/dependency_format.rs b/compiler/rustc_metadata/src/dependency_format.rs index 641d1d8e798..e8de0acb7c9 100644 --- a/compiler/rustc_metadata/src/dependency_format.rs +++ b/compiler/rustc_metadata/src/dependency_format.rs @@ -77,7 +77,7 @@ pub(crate) fn calculate(tcx: TyCtxt<'_>) -> Dependencies { verify_ok(tcx, &linkage); (ty, linkage) }) - .collect::<Vec<_>>() + .collect() } fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList { diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index e67db5d3478..df5b06c6d16 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -2161,10 +2161,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { fn encode_dylib_dependency_formats(&mut self) -> LazyArray<Option<LinkagePreference>> { empty_proc_macro!(self); let formats = self.tcx.dependency_formats(()); - for (ty, arr) in formats.iter() { - if *ty != CrateType::Dylib { - continue; - } + if let Some(arr) = formats.get(&CrateType::Dylib) { return self.lazy_array(arr.iter().map(|slot| match *slot { Linkage::NotLinked | Linkage::IncludedFromDylib => None, |
