Skip to content

Commit 90fc862

Browse files
committed
Auto merge of #116707 - cjgillot:slice-id, r=oli-obk,RalfJung
Create an `AllocId` for `ConstValue::Slice`. This PR modifies `ConstValue::Slice` to use an `AllocId` instead of directly manipulating the allocation. This was originally proposed by rust-lang/rust#115764 but was a perf regression. Almost 2 years later, enough code has changed to make this a perf improvement: rust-lang/rust#116707 (comment)
2 parents 04f11f2 + b8e321e commit 90fc862

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/non_copy_const.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl<'tcx> NonCopyConst<'tcx> {
338338
tcx: TyCtxt<'tcx>,
339339
typing_env: TypingEnv<'tcx>,
340340
ty: Ty<'tcx>,
341-
val: ConstValue<'tcx>,
341+
val: ConstValue,
342342
) -> Result<bool, ()> {
343343
let ty = tcx.try_normalize_erasing_regions(typing_env, ty).unwrap_or(ty);
344344
match self.is_ty_freeze(tcx, typing_env, ty) {
@@ -477,7 +477,7 @@ impl<'tcx> NonCopyConst<'tcx> {
477477
typing_env: TypingEnv<'tcx>,
478478
typeck: &'tcx TypeckResults<'tcx>,
479479
mut src_expr: &'tcx Expr<'tcx>,
480-
mut val: ConstValue<'tcx>,
480+
mut val: ConstValue,
481481
) -> Result<Option<BorrowSource<'tcx>>, ()> {
482482
let mut parents = tcx.hir_parent_iter(src_expr.hir_id);
483483
let mut ty = typeck.expr_ty(src_expr);

0 commit comments

Comments
 (0)