diff options
| author | Jannis Christopher Köhl <mail@koehl.dev> | 2022-10-07 01:10:10 +0200 |
|---|---|---|
| committer | Jannis Christopher Köhl <mail@koehl.dev> | 2022-11-07 10:35:21 +0100 |
| commit | 3c0f3b04b52134b870baf2ca8cedc5067cc5cb7e (patch) | |
| tree | 8ccd6cb6e2ec74e25ede887804d07a02d8dc801c /compiler/rustc_middle | |
| parent | 111324e17cd5d6c1181ea592051583a88bbe0f18 (diff) | |
| download | rust-3c0f3b04b52134b870baf2ca8cedc5067cc5cb7e.tar.gz rust-3c0f3b04b52134b870baf2ca8cedc5067cc5cb7e.zip | |
Only assume Stacked Borrows if -Zunsound-mir-opts is given
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/mir/visit.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs index ddcf3711bfc..d87eb28970e 100644 --- a/compiler/rustc_middle/src/mir/visit.rs +++ b/compiler/rustc_middle/src/mir/visit.rs @@ -1320,6 +1320,15 @@ impl PlaceContext { ) } + /// Returns `true` if this place context represents an address-of. + pub fn is_address_of(&self) -> bool { + matches!( + self, + PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) + | PlaceContext::MutatingUse(MutatingUseContext::AddressOf) + ) + } + /// Returns `true` if this place context represents a storage live or storage dead marker. #[inline] pub fn is_storage_marker(&self) -> bool { |
