Skip to content

Commit 4c00aa3

Browse files
committed
Always run builder to evaluate constants
We were previously skipping it for non-generic functions, but this was leaving some constants unevaluated.
1 parent 08036a8 commit 4c00aa3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_smir/src/rustc_smir/builder.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ impl<'tcx> BodyBuilder<'tcx> {
2121

2222
pub fn build(mut self, tables: &mut Tables<'tcx>) -> stable_mir::mir::Body {
2323
let mut body = self.tcx.instance_mir(self.instance.def).clone();
24-
let generics = self.tcx.generics_of(self.instance.def_id());
25-
if generics.requires_monomorphization(self.tcx) {
26-
self.visit_body(&mut body);
27-
}
24+
self.visit_body(&mut body);
2825
body.stable(tables)
2926
}
3027

0 commit comments

Comments
 (0)