Skip to content

Stop using inherent impl to generate auto/blanket impl #97129

Open
@notriddle

Description

@notriddle

if did.is_local() {
for def_id in prim.impls(cx.tcx) {
let impls = get_auto_trait_and_blanket_impls(cx, def_id);
new_items_external.extend(impls.filter(|i| cx.inlined.insert(i.item_id)));
}
}

This tactic of using inherent impl blocks for getting
auto traits and blanket impls is a hack. What we really
want is to check if [T] impls Send, which has
nothing to do with the inherent impl.

Rustdoc currently uses these impl block as a source of
the Ty, as well as the ParamEnv, SubstsRef, and
Generics. To avoid relying on the impl block, these
things would need to be created from wholecloth, in a
form that is valid for use in type inference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-technical-debtArea: Internal cleanup workT-rustdocRelevant to the rustdoc 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