-
Notifications
You must be signed in to change notification settings - Fork 50
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
Refactor handling of MIR bodies #765
Conversation
pub struct BodyId { | ||
def_id: LocalDefId, | ||
pub promoted: Option<Promoted>, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FINALLY, GOOD, THANKS. Incidentally, I've seen discussions about giving promoteds their own DefId
s but this is good.
) -> CreusotResult<(PreSignature<'tcx>, fmir::Body<'tcx>)> { | ||
let func_translator = BodyTranslator::build_context(ctx.tcx, ctx, &body, parent); | ||
let body = ctx.body(body_id).clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we didn't have to clone the body here but if that turns out to be a perf issue later, we can always either wrap it in an Rc
or use interior mutability in ctx
like rustc does.
lgtm |
This enables translating const fns.