about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-06-02 09:05:37 -0400
committerRalf Jung <post@ralfj.de>2022-06-02 10:46:13 -0400
commitfafccdced349d655db83e0ec30e91b85dcf65cf7 (patch)
treeac2824389ec482db03424576e022e3e304ef54a2 /compiler/rustc_middle/src
parent5e6bb83268518dcd74c96b5504f485b71e604e4c (diff)
downloadrust-fafccdced349d655db83e0ec30e91b85dcf65cf7.tar.gz
rust-fafccdced349d655db83e0ec30e91b85dcf65cf7.zip
add cast kind of from_exposed_addr (int-to-ptr casts)
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index d9cdca8bcb5..f3db359ec33 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -2613,12 +2613,18 @@ impl<'tcx> Rvalue<'tcx> {
 
 #[derive(Clone, Copy, Debug, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable)]
 pub enum CastKind {
-    Misc,
     /// An exposing pointer to address cast. A cast between a pointer and an integer type, or
     /// between a function pointer and an integer type.
     /// See the docs on `expose_addr` for more details.
     PointerExposeAddress,
+    /// An address-to-pointer cast that picks up an exposed provenance.
+    /// See the docs on `from_exposed_addr` for more details.
+    PointerFromExposedAddress,
+    /// All sorts of pointer-to-pointer casts. Note that reference-to-raw-ptr casts are
+    /// translated into `&raw mut/const *r`, i.e., they are not actually casts.
     Pointer(PointerCast),
+    /// Remaining unclassified casts.
+    Misc,
 }
 
 #[derive(Clone, Debug, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable)]