X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_typeck%2Fsrc%2Fconstrained_generic_params.rs;h=909c99adab5d2d91f6162e86d206896e145f8e3b;hb=770ee32b34a5b7e46185c7104d42ee1c51fe4257;hp=a0c8fc822dffd88769c78094b71dda48211d0125;hpb=f8335d96fa624676e201562c614869965e3074d8;p=rust.git diff --git a/compiler/rustc_typeck/src/constrained_generic_params.rs b/compiler/rustc_typeck/src/constrained_generic_params.rs index a0c8fc822df..909c99adab5 100644 --- a/compiler/rustc_typeck/src/constrained_generic_params.rs +++ b/compiler/rustc_typeck/src/constrained_generic_params.rs @@ -79,11 +79,11 @@ fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow { ControlFlow::CONTINUE } - fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> ControlFlow { - match c.val { + fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow { + match c.val() { ty::ConstKind::Unevaluated(..) if !self.include_nonconstraining => { // Constant expressions are not injective - return c.ty.visit_with(self); + return c.ty().visit_with(self); } ty::ConstKind::Param(data) => { self.parameters.push(Parameter::from(data));