Skip to content

Commit 6450014

Browse files
authored
Rollup merge of rust-lang#134010 - RalfJung:promoted-type-error-ice, r=oli-obk
fix ICE on type error in promoted Fixes rust-lang#133968 Ensure that when we turn a type error into a "this promoted failed to evaluate" error, we do record this as something that may happen even in "infallible" promoteds.
2 parents 59392be + a9594c1 commit 6450014

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clippy_lints/src/non_copy_const.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_hir::{
1111
BodyId, Expr, ExprKind, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, Node, TraitItem, TraitItemKind, UnOp,
1212
};
1313
use rustc_lint::{LateContext, LateLintPass, Lint};
14-
use rustc_middle::mir::interpret::{ErrorHandled, EvalToValTreeResult, GlobalId};
14+
use rustc_middle::mir::interpret::{ErrorHandled, EvalToValTreeResult, GlobalId, ReportedErrorInfo};
1515
use rustc_middle::ty::adjustment::Adjust;
1616
use rustc_middle::ty::{self, Ty, TyCtxt};
1717
use rustc_session::impl_lint_pass;
@@ -302,7 +302,10 @@ impl<'tcx> NonCopyConst<'tcx> {
302302
tcx.const_eval_global_id_for_typeck(typing_env, cid, span)
303303
},
304304
Ok(None) => Err(ErrorHandled::TooGeneric(span)),
305-
Err(err) => Err(ErrorHandled::Reported(err.into(), span)),
305+
Err(err) => Err(ErrorHandled::Reported(
306+
ReportedErrorInfo::non_const_eval_error(err),
307+
span,
308+
)),
306309
}
307310
}
308311
}

0 commit comments

Comments
 (0)