diff options
| author | David Wood <david@davidtw.co> | 2020-08-04 18:16:39 +0100 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2020-08-04 20:09:29 +0100 |
| commit | 70b49c7bddec33e6972610e024fcbb3576aa9be3 (patch) | |
| tree | 06e73a7c4272fbbb4761889263099b558038c327 /src/librustc_metadata | |
| parent | 5f89f02c4e7d06dcb94434b8b30ce457b06eda5c (diff) | |
| download | rust-70b49c7bddec33e6972610e024fcbb3576aa9be3.tar.gz rust-70b49c7bddec33e6972610e024fcbb3576aa9be3.zip | |
metadata: skip empty polymorphization bitset
This commit skips encoding empty polymorphization results - while polymorphization is disabled, this should be every polymorphization result; but when polymorphization is re-enabled, this would help with non-generic functions and those which do use all their parameters (most functions). Signed-off-by: David Wood <david@davidtw.co>
Diffstat (limited to 'src/librustc_metadata')
| -rw-r--r-- | src/librustc_metadata/rmeta/encoder.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/librustc_metadata/rmeta/encoder.rs b/src/librustc_metadata/rmeta/encoder.rs index 352b8bff7e2..aec9e8daa0f 100644 --- a/src/librustc_metadata/rmeta/encoder.rs +++ b/src/librustc_metadata/rmeta/encoder.rs @@ -1134,8 +1134,11 @@ impl EncodeContext<'a, 'tcx> { debug!("EntryBuilder::encode_mir({:?})", def_id); if self.tcx.mir_keys(LOCAL_CRATE).contains(&def_id) { record!(self.tables.mir[def_id.to_def_id()] <- self.tcx.optimized_mir(def_id)); - record!(self.tables.unused_generic_params[def_id.to_def_id()] <- - self.tcx.unused_generic_params(def_id)); + + let unused = self.tcx.unused_generic_params(def_id); + if !unused.is_empty() { + record!(self.tables.unused_generic_params[def_id.to_def_id()] <- unused); + } } } |
