mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
Always run builder to evaluate constants
We were previously skipping it for non-generic functions, but this was leaving some constants unevaluated.
This commit is contained in:
parent
08036a8005
commit
4c00aa3d74
@ -21,10 +21,7 @@ impl<'tcx> BodyBuilder<'tcx> {
|
||||
|
||||
pub fn build(mut self, tables: &mut Tables<'tcx>) -> stable_mir::mir::Body {
|
||||
let mut body = self.tcx.instance_mir(self.instance.def).clone();
|
||||
let generics = self.tcx.generics_of(self.instance.def_id());
|
||||
if generics.requires_monomorphization(self.tcx) {
|
||||
self.visit_body(&mut body);
|
||||
}
|
||||
self.visit_body(&mut body);
|
||||
body.stable(tables)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user