Skip to content

Unnecessary closure in rustc_mir/build/mod.rs #53608

Closed
@bjorn3

Description

@bjorn3

Itunsupported is only called on line 53:

let unsupported = || {
span_bug!(tcx.hir.span(id), "can't build MIR for {:?}", def_id);
};
// Figure out what primary body this item has.
let body_id = match tcx.hir.get(id) {
hir::map::NodeVariant(variant) =>
return create_constructor_shim(tcx, id, &variant.node.data),
hir::map::NodeStructCtor(ctor) =>
return create_constructor_shim(tcx, id, ctor),
_ => match tcx.hir.maybe_body_owned_by(id) {
Some(body) => body,
None => unsupported(),

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions