Skip to content
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

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

Closed
bjorn3 opened this issue Aug 22, 2018 · 0 comments
Closed

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

bjorn3 opened this issue Aug 22, 2018 · 0 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Aug 22, 2018

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(),

@estebank estebank added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Aug 22, 2018
kennytm added a commit to kennytm/rust that referenced this issue Aug 24, 2018
Remove unnecessary closure in rustc_mir/build/mod.rs

Fixes rust-lang#53608
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

2 participants