about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-20 17:22:16 +0100
committerGitHub <noreply@github.com>2019-12-20 17:22:16 +0100
commitef013308876f28d13d835808892740f2e7f1a37c (patch)
tree304633c7038d4bf194ce18887f224ee3d66ecdf3 /src/libsyntax
parent6b561b4917e803c4be4ca44d8e552b680cb9e380 (diff)
parenta74911662e8de2c024ea188e4dcac6a494c74455 (diff)
downloadrust-ef013308876f28d13d835808892740f2e7f1a37c.tar.gz
rust-ef013308876f28d13d835808892740f2e7f1a37c.zip
Rollup merge of #64588 - matthewjasper:mir-address-of, r=oli-obk
Add a raw "address of" operator

* Parse and feature gate `&raw [const | mut] expr` (feature gate name is `raw_address_of`)
* Add `mir::Rvalue::AddressOf`
* Use the new `Rvalue` for:
    * the new syntax
    * reference to pointer casts
    * drop shims for slices and arrays
* Stop using `mir::Rvalue::Cast` with a reference as the operand
* Correctly evaluate `mir::Rvalue::{Ref, AddressOf}` in constant propagation

cc @Centril @RalfJung @oli-obk @eddyb
cc #64490
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 92ba071a03d..274e19ec3e4 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -728,13 +728,13 @@ impl Mutability {
 #[derive(Clone, Copy, PartialEq, Eq, Debug)]
 #[derive(RustcEncodable, RustcDecodable, HashStable_Generic)]
 pub enum BorrowKind {
-    /// A raw borrow, `&raw const $expr` or `&raw mut $expr`.
-    /// The resulting type is either `*const T` or `*mut T`
-    /// where `T = typeof($expr)`.
-    Ref,
     /// A normal borrow, `&$expr` or `&mut $expr`.
     /// The resulting type is either `&'a T` or `&'a mut T`
     /// where `T = typeof($expr)` and `'a` is some lifetime.
+    Ref,
+    /// A raw borrow, `&raw const $expr` or `&raw mut $expr`.
+    /// The resulting type is either `*const T` or `*mut T`
+    /// where `T = typeof($expr)`.
     Raw,
 }