diff options
| author | Obei Sideg <obei.sideg@gmail.com> | 2023-05-08 23:38:54 +0300 |
|---|---|---|
| committer | Obei Sideg <obei.sideg@gmail.com> | 2023-05-10 09:54:56 +0300 |
| commit | 2198faeee2a1e3abf30fa71a032aa76c2545c4e3 (patch) | |
| tree | 7b3237c1cc7b94b03f0597674e8beb07cf45e7e7 /compiler/rustc_borrowck/src | |
| parent | a0111af531178e48375f14f838d7a2298524067c (diff) | |
| download | rust-2198faeee2a1e3abf30fa71a032aa76c2545c4e3.tar.gz rust-2198faeee2a1e3abf30fa71a032aa76c2545c4e3.zip | |
Make `NonUseContext::AscribeUserTy` carry `ty::Variance`
Diffstat (limited to 'compiler/rustc_borrowck/src')
| -rw-r--r-- | compiler/rustc_borrowck/src/def_use.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/type_check/mod.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_borrowck/src/def_use.rs b/compiler/rustc_borrowck/src/def_use.rs index 74e6ce37e97..b775739fed2 100644 --- a/compiler/rustc_borrowck/src/def_use.rs +++ b/compiler/rustc_borrowck/src/def_use.rs @@ -55,7 +55,7 @@ pub fn categorize(context: PlaceContext) -> Option<DefUse> { // `PlaceMention` and `AscribeUserType` both evaluate the place, which must not // contain dangling references. PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention) | - PlaceContext::NonUse(NonUseContext::AscribeUserTy) | + PlaceContext::NonUse(NonUseContext::AscribeUserTy(_)) | PlaceContext::MutatingUse(MutatingUseContext::AddressOf) | PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) | diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index dcabeb792be..33b24b68f7c 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -777,7 +777,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> { Inspect | Copy | Move | PlaceMention | SharedBorrow | ShallowBorrow | UniqueBorrow | AddressOf | Projection, ) => ty::Covariant, - PlaceContext::NonUse(AscribeUserTy) => ty::Covariant, + PlaceContext::NonUse(AscribeUserTy(variance)) => variance, } } |
