Skip to content

Commit e9a0c42

Browse files
committed
Overhaul TyS and Ty.
Specifically, change `Ty` from this: ``` pub type Ty<'tcx> = &'tcx TyS<'tcx>; ``` to this ``` pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>); ``` There are two benefits to this. - It's now a first class type, so we can define methods on it. This means we can move a lot of methods away from `TyS`, leaving `TyS` as a barely-used type, which is appropriate given that it's not meant to be used directly. - The uniqueness requirement is now explicit, via the `Interned` type. E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather than via `TyS`, which wasn't obvious at all. Much of this commit is boring churn. The interesting changes are in these files: - compiler/rustc_middle/src/arena.rs - compiler/rustc_middle/src/mir/visit.rs - compiler/rustc_middle/src/ty/context.rs - compiler/rustc_middle/src/ty/mod.rs Specifically: - Most mentions of `TyS` are removed. It's very much a dumb struct now; `Ty` has all the smarts. - `TyS` now has `crate` visibility instead of `pub`. - `TyS::make_for_test` is removed in favour of the static `BOOL_TY`, which just works better with the new structure. - The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned` (pointer-based, for the `Equal` case) and partly on `TyS` (contents-based, for the other cases). - There are many tedious sigil adjustments, i.e. adding or removing `*` or `&`. They seem to be unavoidable.
1 parent 0c2ebbd commit e9a0c42

File tree

145 files changed

+521
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+521
-533
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,7 +2324,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
23242324
// This is also case 2 from above but for functions, return type is still an
23252325
// anonymous reference so we select the first argument.
23262326
let argument_span = fn_decl.inputs.first()?.span;
2327-
let argument_ty = sig.inputs().skip_binder().first()?;
2327+
let argument_ty = *sig.inputs().skip_binder().first()?;
23282328

23292329
let return_span = fn_decl.output.span();
23302330
let return_ty = sig.output().skip_binder();
@@ -2379,27 +2379,27 @@ impl<'tcx> AnnotatedBorrowFnSignature<'tcx> {
23792379
diag: &mut DiagnosticBuilder<'_>,
23802380
) -> String {
23812381
match self {
2382-
AnnotatedBorrowFnSignature::Closure { argument_ty, argument_span } => {
2382+
&AnnotatedBorrowFnSignature::Closure { argument_ty, argument_span } => {
23832383
diag.span_label(
2384-
*argument_span,
2384+
argument_span,
23852385
format!("has type `{}`", cx.get_name_for_ty(argument_ty, 0)),
23862386
);
23872387

23882388
cx.get_region_name_for_ty(argument_ty, 0)
23892389
}
2390-
AnnotatedBorrowFnSignature::AnonymousFunction {
2390+
&AnnotatedBorrowFnSignature::AnonymousFunction {
23912391
argument_ty,
23922392
argument_span,
23932393
return_ty,
23942394
return_span,
23952395
} => {
23962396
let argument_ty_name = cx.get_name_for_ty(argument_ty, 0);
2397-
diag.span_label(*argument_span, format!("has type `{}`", argument_ty_name));
2397+
diag.span_label(argument_span, format!("has type `{}`", argument_ty_name));
23982398

23992399
let return_ty_name = cx.get_name_for_ty(return_ty, 0);
24002400
let types_equal = return_ty_name == argument_ty_name;
24012401
diag.span_label(
2402-
*return_span,
2402+
return_span,
24032403
format!(
24042404
"{}has type `{}`",
24052405
if types_equal { "also " } else { "" },
@@ -2419,7 +2419,7 @@ impl<'tcx> AnnotatedBorrowFnSignature<'tcx> {
24192419
}
24202420
AnnotatedBorrowFnSignature::NamedFunction { arguments, return_ty, return_span } => {
24212421
// Region of return type and arguments checked to be the same earlier.
2422-
let region_name = cx.get_region_name_for_ty(return_ty, 0);
2422+
let region_name = cx.get_region_name_for_ty(*return_ty, 0);
24232423
for (_, argument_span) in arguments {
24242424
diag.span_label(*argument_span, format!("has lifetime `{}`", region_name));
24252425
}

compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,18 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
331331
match place {
332332
PlaceRef { local, projection: [] } => {
333333
let local = &self.body.local_decls[local];
334-
self.describe_field_from_ty(&local.ty, field, None)
334+
self.describe_field_from_ty(local.ty, field, None)
335335
}
336336
PlaceRef { local, projection: [proj_base @ .., elem] } => match elem {
337337
ProjectionElem::Deref => {
338338
self.describe_field(PlaceRef { local, projection: proj_base }, field)
339339
}
340340
ProjectionElem::Downcast(_, variant_index) => {
341341
let base_ty = place.ty(self.body, self.infcx.tcx).ty;
342-
self.describe_field_from_ty(&base_ty, field, Some(*variant_index))
342+
self.describe_field_from_ty(base_ty, field, Some(*variant_index))
343343
}
344344
ProjectionElem::Field(_, field_type) => {
345-
self.describe_field_from_ty(&field_type, field, None)
345+
self.describe_field_from_ty(*field_type, field, None)
346346
}
347347
ProjectionElem::Index(..)
348348
| ProjectionElem::ConstantIndex { .. }
@@ -362,7 +362,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
362362
) -> String {
363363
if ty.is_box() {
364364
// If the type is a box, the field is described from the boxed type
365-
self.describe_field_from_ty(&ty.boxed_ty(), field, variant_index)
365+
self.describe_field_from_ty(ty.boxed_ty(), field, variant_index)
366366
} else {
367367
match *ty.kind() {
368368
ty::Adt(def, _) => {
@@ -376,10 +376,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
376376
}
377377
ty::Tuple(_) => field.index().to_string(),
378378
ty::Ref(_, ty, _) | ty::RawPtr(ty::TypeAndMut { ty, .. }) => {
379-
self.describe_field_from_ty(&ty, field, variant_index)
379+
self.describe_field_from_ty(ty, field, variant_index)
380380
}
381381
ty::Array(ty, _) | ty::Slice(ty) => {
382-
self.describe_field_from_ty(&ty, field, variant_index)
382+
self.describe_field_from_ty(ty, field, variant_index)
383383
}
384384
ty::Closure(def_id, _) | ty::Generator(def_id, _, _) => {
385385
// We won't be borrowck'ing here if the closure came from another crate,

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,18 +246,18 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
246246
);
247247
(
248248
match kind {
249-
IllegalMoveOriginKind::BorrowedContent { target_place } => self
249+
&IllegalMoveOriginKind::BorrowedContent { target_place } => self
250250
.report_cannot_move_from_borrowed_content(
251251
original_path,
252-
*target_place,
252+
target_place,
253253
span,
254254
use_spans,
255255
),
256-
IllegalMoveOriginKind::InteriorOfTypeWithDestructor { container_ty: ty } => {
256+
&IllegalMoveOriginKind::InteriorOfTypeWithDestructor { container_ty: ty } => {
257257
self.cannot_move_out_of_interior_of_drop(span, ty)
258258
}
259-
IllegalMoveOriginKind::InteriorOfSliceOrArray { ty, is_index } => {
260-
self.cannot_move_out_of_interior_noncopy(span, ty, Some(*is_index))
259+
&IllegalMoveOriginKind::InteriorOfSliceOrArray { ty, is_index } => {
260+
self.cannot_move_out_of_interior_noncopy(span, ty, Some(is_index))
261261
}
262262
},
263263
span,

compiler/rustc_borrowck/src/diagnostics/region_name.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
500500
}
501501

502502
// Otherwise, let's descend into the referent types.
503-
search_stack.push((referent_ty, &referent_hir_ty.ty));
503+
search_stack.push((*referent_ty, &referent_hir_ty.ty));
504504
}
505505

506506
// Match up something like `Foo<'1>`
@@ -539,7 +539,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
539539

540540
(ty::Slice(elem_ty), hir::TyKind::Slice(elem_hir_ty))
541541
| (ty::Array(elem_ty, _), hir::TyKind::Array(elem_hir_ty, _)) => {
542-
search_stack.push((elem_ty, elem_hir_ty));
542+
search_stack.push((*elem_ty, elem_hir_ty));
543543
}
544544

545545
(ty::RawPtr(mut_ty), hir::TyKind::Ptr(mut_hir_ty)) => {

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11691169

11701170
match verify_bound {
11711171
VerifyBound::IfEq(test_ty, verify_bound1) => {
1172-
self.eval_if_eq(tcx, body, generic_ty, lower_bound, test_ty, verify_bound1)
1172+
self.eval_if_eq(tcx, body, generic_ty, lower_bound, *test_ty, verify_bound1)
11731173
}
11741174

11751175
VerifyBound::IsEmpty => {

compiler/rustc_borrowck/src/renumber.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for NllVisitor<'a, 'tcx> {
5757

5858
#[instrument(skip(self), level = "debug")]
5959
fn visit_ty(&mut self, ty: &mut Ty<'tcx>, ty_context: TyContext) {
60-
*ty = self.renumber_regions(ty);
60+
*ty = self.renumber_regions(*ty);
6161

6262
debug!(?ty);
6363
}

compiler/rustc_borrowck/src/type_check/constraint_conversion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
105105
// create new region variables, which can't be done later when
106106
// verifying these bounds.
107107
if t1.has_placeholders() {
108-
t1 = tcx.fold_regions(&t1, &mut false, |r, _| match *r {
108+
t1 = tcx.fold_regions(t1, &mut false, |r, _| match *r {
109109
ty::RegionKind::RePlaceholder(placeholder) => {
110110
self.constraints.placeholder_region(self.infcx, placeholder)
111111
}

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
482482
// then remove the outermost reference so we can check the
483483
// type annotation for the remaining type.
484484
if let ty::Ref(_, rty, _) = local_decl.ty.kind() {
485-
rty
485+
*rty
486486
} else {
487487
bug!("{:?} with ref binding has wrong type {}", local, local_decl.ty);
488488
}
@@ -716,7 +716,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
716716
PlaceTy::from_ty(match base_ty.kind() {
717717
ty::Array(inner, _) => {
718718
assert!(!from_end, "array subslices should not use from_end");
719-
tcx.mk_array(inner, to - from)
719+
tcx.mk_array(*inner, to - from)
720720
}
721721
ty::Slice(..) => {
722722
assert!(from_end, "slice subslices should use from_end");
@@ -1737,7 +1737,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
17371737
ConstraintCategory::Boring
17381738
};
17391739
if let Err(terr) =
1740-
self.sub_types(op_arg_ty, fn_arg, term_location.to_locations(), category)
1740+
self.sub_types(op_arg_ty, *fn_arg, term_location.to_locations(), category)
17411741
{
17421742
span_mirbug!(
17431743
self,
@@ -2048,7 +2048,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20482048
}
20492049
}
20502050

2051-
Rvalue::NullaryOp(_, ty) => {
2051+
&Rvalue::NullaryOp(_, ty) => {
20522052
let trait_ref = ty::TraitRef {
20532053
def_id: tcx.require_lang_item(LangItem::Sized, Some(self.last_span)),
20542054
substs: tcx.mk_substs_trait(ty, &[]),
@@ -2066,7 +2066,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20662066

20672067
let trait_ref = ty::TraitRef {
20682068
def_id: tcx.require_lang_item(LangItem::Sized, Some(self.last_span)),
2069-
substs: tcx.mk_substs_trait(ty, &[]),
2069+
substs: tcx.mk_substs_trait(*ty, &[]),
20702070
};
20712071

20722072
self.prove_trait_ref(
@@ -2093,7 +2093,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20932093
let ty_fn_ptr_from = tcx.mk_fn_ptr(fn_sig);
20942094

20952095
if let Err(terr) = self.eq_types(
2096-
ty,
2096+
*ty,
20972097
ty_fn_ptr_from,
20982098
location.to_locations(),
20992099
ConstraintCategory::Cast,
@@ -2117,7 +2117,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21172117
let ty_fn_ptr_from = tcx.mk_fn_ptr(tcx.signature_unclosure(sig, *unsafety));
21182118

21192119
if let Err(terr) = self.eq_types(
2120-
ty,
2120+
*ty,
21212121
ty_fn_ptr_from,
21222122
location.to_locations(),
21232123
ConstraintCategory::Cast,
@@ -2146,7 +2146,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21462146
let ty_fn_ptr_from = tcx.safe_to_unsafe_fn_ty(fn_sig);
21472147

21482148
if let Err(terr) = self.eq_types(
2149-
ty,
2149+
*ty,
21502150
ty_fn_ptr_from,
21512151
location.to_locations(),
21522152
ConstraintCategory::Cast,
@@ -2209,8 +2209,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22092209
}
22102210
};
22112211
if let Err(terr) = self.sub_types(
2212-
ty_from,
2213-
ty_to,
2212+
*ty_from,
2213+
*ty_to,
22142214
location.to_locations(),
22152215
ConstraintCategory::Cast,
22162216
) {
@@ -2278,8 +2278,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22782278
}
22792279

22802280
if let Err(terr) = self.sub_types(
2281-
ty_elem,
2282-
ty_to,
2281+
*ty_elem,
2282+
*ty_to,
22832283
location.to_locations(),
22842284
ConstraintCategory::Cast,
22852285
) {
@@ -2297,7 +2297,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22972297
CastKind::Misc => {
22982298
let ty_from = op.ty(body, tcx);
22992299
let cast_ty_from = CastTy::from_ty(ty_from);
2300-
let cast_ty_to = CastTy::from_ty(ty);
2300+
let cast_ty_to = CastTy::from_ty(*ty);
23012301
match (cast_ty_from, cast_ty_to) {
23022302
(None, _)
23032303
| (_, None | Some(CastTy::FnPtr))

compiler/rustc_borrowck/src/universal_regions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
512512
first_local_index,
513513
num_universals,
514514
defining_ty,
515-
unnormalized_output_ty,
515+
unnormalized_output_ty: *unnormalized_output_ty,
516516
unnormalized_input_tys,
517517
yield_ty,
518518
}

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub(crate) fn codegen_fn<'tcx>(
7979
let arg_uninhabited = fx
8080
.mir
8181
.args_iter()
82-
.any(|arg| fx.layout_of(fx.monomorphize(&fx.mir.local_decls[arg].ty)).abi.is_uninhabited());
82+
.any(|arg| fx.layout_of(fx.monomorphize(fx.mir.local_decls[arg].ty)).abi.is_uninhabited());
8383

8484
if !crate::constant::check_constants(&mut fx) {
8585
fx.bcx.append_block_params_for_function_params(fx.block_map[START_BLOCK]);
@@ -818,16 +818,16 @@ pub(crate) fn codegen_place<'tcx>(
818818
match cplace.layout().ty.kind() {
819819
ty::Array(elem_ty, _len) => {
820820
assert!(!from_end, "array subslices are never `from_end`");
821-
let elem_layout = fx.layout_of(elem_ty);
821+
let elem_layout = fx.layout_of(*elem_ty);
822822
let ptr = cplace.to_ptr();
823823
cplace = CPlace::for_ptr(
824824
ptr.offset_i64(fx, elem_layout.size.bytes() as i64 * (from as i64)),
825-
fx.layout_of(fx.tcx.mk_array(elem_ty, to - from)),
825+
fx.layout_of(fx.tcx.mk_array(*elem_ty, to - from)),
826826
);
827827
}
828828
ty::Slice(elem_ty) => {
829829
assert!(from_end, "slice subslices should be `from_end`");
830-
let elem_layout = fx.layout_of(elem_ty);
830+
let elem_layout = fx.layout_of(*elem_ty);
831831
let (ptr, len) = cplace.to_ptr_maybe_unsized();
832832
let len = len.unwrap();
833833
cplace = CPlace::for_ptr_with_extra(

compiler/rustc_codegen_cranelift/src/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn clif_type_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<types::Typ
6161
},
6262
ty::FnPtr(_) => pointer_ty(tcx),
6363
ty::RawPtr(TypeAndMut { ty: pointee_ty, mutbl: _ }) | ty::Ref(_, pointee_ty, _) => {
64-
if has_ptr_meta(tcx, pointee_ty) {
64+
if has_ptr_meta(tcx, *pointee_ty) {
6565
return None;
6666
} else {
6767
pointer_ty(tcx)
@@ -100,7 +100,7 @@ fn clif_pair_type_from_ty<'tcx>(
100100
(a, b)
101101
}
102102
ty::RawPtr(TypeAndMut { ty: pointee_ty, mutbl: _ }) | ty::Ref(_, pointee_ty, _) => {
103-
if has_ptr_meta(tcx, pointee_ty) {
103+
if has_ptr_meta(tcx, *pointee_ty) {
104104
(pointer_ty(tcx), pointer_ty(tcx))
105105
} else {
106106
return None;

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
490490
return None;
491491
}
492492
let const_val = mir_operand_get_const_val(fx, operand)?;
493-
if fx.layout_of(ty).size
493+
if fx.layout_of(*ty).size
494494
!= const_val.try_to_scalar_int()?.size()
495495
{
496496
return None;

compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl<'tcx> DebugContext<'tcx> {
114114
}
115115

116116
fn dwarf_ty(&mut self, ty: Ty<'tcx>) -> UnitEntryId {
117-
if let Some(type_id) = self.types.get(ty) {
117+
if let Some(type_id) = self.types.get(&ty) {
118118
return *type_id;
119119
}
120120

@@ -143,7 +143,7 @@ impl<'tcx> DebugContext<'tcx> {
143143
// Ensure that type is inserted before recursing to avoid duplicates
144144
self.types.insert(ty, type_id);
145145

146-
let pointee = self.dwarf_ty(pointee_ty);
146+
let pointee = self.dwarf_ty(*pointee_ty);
147147

148148
let type_entry = self.dwarf.unit.get_mut(type_id);
149149

compiler/rustc_codegen_cranelift/src/unsize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn unsize_ptr<'tcx>(
6666
(&ty::Ref(_, a, _), &ty::Ref(_, b, _))
6767
| (&ty::Ref(_, a, _), &ty::RawPtr(ty::TypeAndMut { ty: b, .. }))
6868
| (&ty::RawPtr(ty::TypeAndMut { ty: a, .. }), &ty::RawPtr(ty::TypeAndMut { ty: b, .. })) => {
69-
(src, unsized_info(fx, a, b, old_info))
69+
(src, unsized_info(fx, *a, *b, old_info))
7070
}
7171
(&ty::Adt(def_a, _), &ty::Adt(def_b, _)) if def_a.is_box() && def_b.is_box() => {
7272
let (a, b) = (src_layout.ty.boxed_ty(), dst_layout.ty.boxed_ty());

compiler/rustc_codegen_cranelift/src/value_and_place.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ impl<'tcx> CPlace<'tcx> {
514514
// Can only happen for vector types
515515
let len =
516516
u16::try_from(len.eval_usize(fx.tcx, ParamEnv::reveal_all())).unwrap();
517-
let vector_ty = fx.clif_type(element).unwrap().by(len).unwrap();
517+
let vector_ty = fx.clif_type(*element).unwrap().by(len).unwrap();
518518

519519
let data = match from.0 {
520520
CValueInner::ByRef(ptr, None) => {
@@ -721,8 +721,8 @@ impl<'tcx> CPlace<'tcx> {
721721
index: Value,
722722
) -> CPlace<'tcx> {
723723
let (elem_layout, ptr) = match self.layout().ty.kind() {
724-
ty::Array(elem_ty, _) => (fx.layout_of(elem_ty), self.to_ptr()),
725-
ty::Slice(elem_ty) => (fx.layout_of(elem_ty), self.to_ptr_maybe_unsized().0),
724+
ty::Array(elem_ty, _) => (fx.layout_of(*elem_ty), self.to_ptr()),
725+
ty::Slice(elem_ty) => (fx.layout_of(*elem_ty), self.to_ptr_maybe_unsized().0),
726726
_ => bug!("place_index({:?})", self.layout().ty),
727727
};
728728

@@ -781,11 +781,11 @@ pub(crate) fn assert_assignable<'tcx>(
781781
ty::RawPtr(TypeAndMut { ty: a, mutbl: _ }),
782782
ty::RawPtr(TypeAndMut { ty: b, mutbl: _ }),
783783
) => {
784-
assert_assignable(fx, a, b);
784+
assert_assignable(fx, *a, *b);
785785
}
786786
(ty::Ref(_, a, _), ty::RawPtr(TypeAndMut { ty: b, mutbl: _ }))
787787
| (ty::RawPtr(TypeAndMut { ty: a, mutbl: _ }), ty::Ref(_, b, _)) => {
788-
assert_assignable(fx, a, b);
788+
assert_assignable(fx, *a, *b);
789789
}
790790
(ty::FnPtr(_), ty::FnPtr(_)) => {
791791
let from_sig = fx.tcx.normalize_erasing_late_bound_regions(

0 commit comments

Comments
 (0)