Skip to content

rustc_attr::Stability inlined a lot of dublicates in rustc dependency crates rmeta's, increasing it's size #88180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
klensy opened this issue Aug 20, 2021 · 1 comment · Fixed by #98770
Labels
A-metadata Area: Crate metadata C-enhancement Category: An issue proposing an enhancement or a PR with one. I-heavy Issue: Problems and improvements with respect to binary size of generated code.

Comments

@klensy
Copy link
Contributor

klensy commented Aug 20, 2021

Look at this place: this Stability value looks like const, but still inserted multiple times into *.rmeta file.

if tcx.sess.opts.debugging_opts.force_unstable_if_unmarked {
let reason = "this crate is being loaded from the sysroot, an \
unstable location; did you mean to load this crate \
from crates.io via `Cargo.toml` instead?";
let stability = tcx.intern_stability(Stability {
level: attr::StabilityLevel::Unstable {
reason: Some(Symbol::intern(reason)),
issue: NonZeroU32::new(27812),
is_soft: false,
},
feature: sym::rustc_private,
});
annotator.parent_stab = Some(stability);

For example, text from reason (and other fields from Stability):
found 172 times in libaddr2line.rmeta
found 911 times in libhashbrown.rmeta
found 9590 times in libobject.rmeta

rustc 1.56.0-nightly (5a19ffe1c 2021-08-13)
binary: rustc
commit-hash: 5a19ffe1c2b99d9e09706cc286aad1ec0868eddb
commit-date: 2021-08-13
host: x86_64-pc-windows-msvc
release: 1.56.0-nightly
LLVM version: 12.0.1

@rustbot label: +I-heavy

@rustbot rustbot added the I-heavy Issue: Problems and improvements with respect to binary size of generated code. label Aug 20, 2021
@klensy
Copy link
Contributor Author

klensy commented Sep 6, 2021

@rustbot label: +A-metadata +C-enhancement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metadata Area: Crate metadata C-enhancement Category: An issue proposing an enhancement or a PR with one. I-heavy Issue: Problems and improvements with respect to binary size of generated code.
Projects
None yet
2 participants