Skip to content

cstore_impl dependency format linkage sometimes unknown  #65890

Closed as not planned
@pnkfelix

Description

@pnkfelix

spawned off of #64872

The match input here (on line 245):

let formats = tcx.dependency_formats(LOCAL_CRATE);
let remove_generics = formats.iter().any(|(_ty, list)| {
match list.get(def_id.krate.as_usize() - 1) {
Some(Linkage::IncludedFromDylib) | Some(Linkage::Dynamic) => true,
_ => false,
}
});

sometimes returns None

Its not yet clear to me under which scenarios that happens. But when it does happen, the dependency may be (re)exported from a static or a dynamic crate. This is probably a sign that the logic here needs to be revised in some way (assuming that the information in question is available somewhere in the data structures; otherwise, we'll need to try to add it).

In any case, this issue is to log the problem, so that I can link to it from any tests I encounter that were previously assuming that the -Z share-generics optimization would always fire in this scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions