diff --git a/compiler/rustc_smir/src/rustc_smir/builder.rs b/compiler/rustc_smir/src/rustc_smir/builder.rs index 7e74a1d92c76f..039bdec4c78a6 100644 --- a/compiler/rustc_smir/src/rustc_smir/builder.rs +++ b/compiler/rustc_smir/src/rustc_smir/builder.rs @@ -6,7 +6,7 @@ use crate::rustc_smir::{Stable, Tables}; use rustc_middle::mir; use rustc_middle::mir::visit::MutVisitor; -use rustc_middle::ty::{self, Ty, TyCtxt}; +use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt}; /// Builds a monomorphic body for a given instance. pub struct BodyBuilder<'tcx> { @@ -68,6 +68,10 @@ impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> { self.super_constant(constant, location); } + fn visit_args(&mut self, args: &mut GenericArgsRef<'tcx>, _: mir::Location) { + *args = self.monomorphize(*args); + } + fn tcx(&self) -> TyCtxt<'tcx> { self.tcx }