Skip to content

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

Closed
@klensy

Description

@klensy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-metadataArea: Crate metadataC-enhancementCategory: An issue proposing an enhancement or a PR with one.I-heavyIssue: Problems and improvements with respect to binary size of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions