diff options
| author | Michael Goulet <michael@errs.io> | 2024-08-25 16:02:11 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-08-25 16:02:29 -0400 |
| commit | 48f43fa0ed2f2e4ff2d9d53b9d72cfbc108a9034 (patch) | |
| tree | 26b26bdc8f2c75b6343e3194409a7c9a16e64cb4 /compiler/rustc_borrowck | |
| parent | 89103466d77a3ae068bab0fd17c53bf7104f627b (diff) | |
| download | rust-48f43fa0ed2f2e4ff2d9d53b9d72cfbc108a9034.tar.gz rust-48f43fa0ed2f2e4ff2d9d53b9d72cfbc108a9034.zip | |
Avoid taking reference of &TyKind
Diffstat (limited to 'compiler/rustc_borrowck')
| -rw-r--r-- | compiler/rustc_borrowck/src/borrowck_errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/places_conflict.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_borrowck/src/borrowck_errors.rs b/compiler/rustc_borrowck/src/borrowck_errors.rs index 76e39fe94af..70f89e80dc9 100644 --- a/compiler/rustc_borrowck/src/borrowck_errors.rs +++ b/compiler/rustc_borrowck/src/borrowck_errors.rs @@ -290,7 +290,7 @@ impl<'infcx, 'tcx> crate::MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> { ty: Ty<'_>, is_index: Option<bool>, ) -> Diag<'infcx> { - let type_name = match (&ty.kind(), is_index) { + let type_name = match (ty.kind(), is_index) { (&ty::Array(_, _), Some(true)) | (&ty::Array(_, _), None) => "array", (&ty::Slice(_), _) => "slice", _ => span_bug!(move_from_span, "this path should not cause illegal move"), diff --git a/compiler/rustc_borrowck/src/places_conflict.rs b/compiler/rustc_borrowck/src/places_conflict.rs index 42d0c2038f8..311f17f15b9 100644 --- a/compiler/rustc_borrowck/src/places_conflict.rs +++ b/compiler/rustc_borrowck/src/places_conflict.rs @@ -201,7 +201,7 @@ fn place_components_conflict<'tcx>( let base_ty = base.ty(body, tcx).ty; - match (elem, &base_ty.kind(), access) { + match (elem, base_ty.kind(), access) { (_, _, Shallow(Some(ArtificialField::ArrayLength))) | (_, _, Shallow(Some(ArtificialField::FakeBorrow))) => { // The array length is like additional fields on the |
