From cbfd88a4863ff88bdfc55f0b05dded82f0bfeb32 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 26 Feb 2013 14:37:31 -0500 Subject: 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. --- src/libsyntax/ast.rs | 9 +++++++++ src/libsyntax/print/pprust.rs | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/libsyntax') 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; #[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; -- cgit 1.4.1-3-g733a5