about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs4
-rw-r--r--src/libsyntax/ast_util.rs2
-rw-r--r--src/libsyntax/ext/deriving/ty.rs2
-rw-r--r--src/libsyntax/parse/parser.rs12
-rw-r--r--src/libsyntax/print/pprust.rs4
5 files changed, 13 insertions, 11 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index bc432c4c7b0..2603cbb2dd7 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -333,7 +333,7 @@ pub enum binop {
 #[deriving(Eq, Encodable, Decodable,IterBytes)]
 pub enum unop {
     box(mutability),
-    uniq(mutability),
+    uniq,
     deref,
     not,
     neg
@@ -805,7 +805,7 @@ pub enum explicit_self_ {
     sty_value,                                 // `self`
     sty_region(Option<@Lifetime>, mutability), // `&'lt self`
     sty_box(mutability),                       // `@self`
-    sty_uniq(mutability)                       // `~self`
+    sty_uniq                                   // `~self`
 }
 
 pub type explicit_self = spanned<explicit_self_>;
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index 9439f45be21..ee7c7180f8d 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -135,7 +135,7 @@ pub fn is_shift_binop(b: binop) -> bool {
 pub fn unop_to_str(op: unop) -> ~str {
     match op {
       box(mt) => if mt == m_mutbl { ~"@mut " } else { ~"@" },
-      uniq(mt) => if mt == m_mutbl { ~"~mut " } else { ~"~" },
+      uniq => ~"~",
       deref => ~"*",
       not => ~"!",
       neg => ~"-"
diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs
index a2f9aa58d99..e210853bfb4 100644
--- a/src/libsyntax/ext/deriving/ty.rs
+++ b/src/libsyntax/ext/deriving/ty.rs
@@ -248,7 +248,7 @@ pub fn get_explicit_self(cx: @ExtCtxt, span: span, self_ptr: &Option<PtrTy>)
             let self_ty = respan(
                 span,
                 match *ptr {
-                    Send => ast::sty_uniq(ast::m_imm),
+                    Send => ast::sty_uniq,
                     Managed(mutbl) => ast::sty_box(mutbl),
                     Borrowed(ref lt, mutbl) => {
                         let lt = lt.map(|s| @cx.lifetime(span,
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index f1b5c4d16be..cc0baa28e20 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2071,9 +2071,8 @@ impl Parser {
             ex = match e.node {
               expr_vec(*) |
               expr_lit(@codemap::spanned { node: lit_str(_), span: _}) |
-              expr_repeat(*)
-              if m == m_imm => expr_vstore(e, expr_vstore_uniq),
-              _ => self.mk_unary(uniq(m), e)
+              expr_repeat(*) => expr_vstore(e, expr_vstore_uniq),
+              _ => self.mk_unary(uniq, e)
             };
           }
           _ => return self.parse_dot_or_call_expr()
@@ -3366,7 +3365,12 @@ impl Parser {
             maybe_parse_explicit_self(sty_box, self)
           }
           token::TILDE => {
-            maybe_parse_explicit_self(sty_uniq, self)
+            maybe_parse_explicit_self(|mutability| {
+                if mutability != m_imm {
+                    self.obsolete(*self.last_span, ObsoleteMutOwnedPointer);
+                }
+                sty_uniq
+            }, self)
           }
           token::IDENT(*) if self.is_self_ident() => {
             self.bump();
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 9a1682bf063..978561eaa67 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -1653,6 +1653,7 @@ pub fn print_explicit_self(s: @ps, explicit_self: ast::explicit_self_) -> bool {
     match explicit_self {
         ast::sty_static => { return false; }
         ast::sty_value => { word(s.s, "self"); }
+        ast::sty_uniq => { word(s.s, "~self"); }
         ast::sty_region(lt, m) => {
             word(s.s, "&");
             print_opt_lifetime(s, lt);
@@ -1662,9 +1663,6 @@ pub fn print_explicit_self(s: @ps, explicit_self: ast::explicit_self_) -> bool {
         ast::sty_box(m) => {
             word(s.s, "@"); print_mutability(s, m); word(s.s, "self");
         }
-        ast::sty_uniq(m) => {
-            word(s.s, "~"); print_mutability(s, m); word(s.s, "self");
-        }
     }
     return true;
 }