]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
stop evaluating constants in `Relate`
[rust.git] / compiler / rustc_typeck / src / check / fn_ctxt / _impl.rs
index c59638f5d6f9f77a6a98c0c4b6103342a0cad91b..b07edd43c0716e430cc408a537648d98e5d3ebdc 100644 (file)
@@ -495,13 +495,10 @@ pub fn array_length_to_const(&self, length: &hir::ArrayLen) -> ty::Const<'tcx> {
 
     pub fn to_const(&self, ast_c: &hir::AnonConst) -> ty::Const<'tcx> {
         let const_def_id = self.tcx.hir().local_def_id(ast_c.hir_id);
+        let span = self.tcx.hir().span(ast_c.hir_id);
         let c = ty::Const::from_anon_const(self.tcx, const_def_id);
-        self.register_wf_obligation(
-            c.into(),
-            self.tcx.hir().span(ast_c.hir_id),
-            ObligationCauseCode::WellFormed(None),
-        );
-        c
+        self.register_wf_obligation(c.into(), span, ObligationCauseCode::WellFormed(None));
+        self.normalize_associated_types_in(span, c)
     }
 
     pub fn const_arg_to_const(