about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2013-02-26 14:37:31 -0500
committerNiko Matsakis <niko@alum.mit.edu>2013-03-05 08:46:23 -0500
commitcbfd88a4863ff88bdfc55f0b05dded82f0bfeb32 (patch)
tree9e4a0892e948214950be6cd4f6b5b4d1c1fea664 /src/libsyntax
parent65986ba0c0b20803dd02a5b0b71e269cbeb8336d (diff)
downloadrust-cbfd88a4863ff88bdfc55f0b05dded82f0bfeb32.tar.gz
rust-cbfd88a4863ff88bdfc55f0b05dded82f0bfeb32.zip
Update region inference for traits so that a method with
explicit self doesn't incorrectly cause the entire trait to
be tagged as being region-parameterized.

Fixes #5224.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs9
-rw-r--r--src/libsyntax/print/pprust.rs1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 47948cc3ead..484fff1f9de 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -1017,6 +1017,15 @@ pub enum self_ty_ {
     sty_uniq(mutability)                // by-unique-pointer self: `~self`
 }
 
+impl self_ty_ {
+    fn is_borrowed(&self) -> bool {
+        match *self {
+            sty_region(_) => true,
+            _ => false
+        }
+    }
+}
+
 pub type self_ty = spanned<self_ty_>;
 
 #[auto_encode]
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 24110125262..735344e43be 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -30,7 +30,6 @@ use print::pprust;
 use core::char;
 use core::dvec::DVec;
 use core::io;
-use core::option;
 use core::str;
 use core::u64;
 use core::vec;