diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index 574506ed232..11b4aa17ec4 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -594,7 +594,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> self.layout_of(ty) })?; let op = match val.val { - ConstValue::Param(_) => Err(EvalErrorKind::TooGeneric.into()), + ConstValue::Param(_) => return Err(EvalErrorKind::TooGeneric.into()), ConstValue::Infer(_) => bug!(), ConstValue::ByRef(ptr, alloc) => { // We rely on mutability being set correctly in that allocation to prevent writes diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 1dec2d483b8..be708c78a0d 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1869,14 +1869,14 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o { ast_const: &hir::AnonConst, ty: Ty<'tcx> ) -> &'tcx ty::LazyConst<'tcx> { - debug!("ast_const_to_const(id={:?}, ast_const={:?})", ast_const.id, ast_const); + debug!("ast_const_to_const(id={:?}, ast_const={:?})", ast_const.hir_id, ast_const); let tcx = self.tcx(); - let def_id = tcx.hir().local_def_id(ast_const.id); + let def_id = tcx.hir().local_def_id_from_hir_id(ast_const.hir_id); let mut lazy_const = ty::LazyConst::Unevaluated( def_id, - Substs::identity_for_item(tcx, def_id) + InternalSubsts::identity_for_item(tcx, def_id), ); let expr = &tcx.hir().body(ast_const.body).value; diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 20b1ab4478a..eb4bbe88069 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -1020,7 +1020,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx ty if !allow_defaults && default.is_some() { if !tcx.features().default_type_parameter_fallback { - tcx.lint_node( + tcx.lint_hir( lint::builtin::INVALID_TYPE_PARAM_DEFAULT, param.hir_id, param.span, @@ -1339,7 +1339,7 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Ty<'tcx> { let args = &generic_args.args; for arg in args { if let GenericArg::Const(ct) = arg { - if ct.value.id == node_id { + if ct.value.hir_id == hir_id { found_const = true; break; }