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.
This commit is contained in:
Niko Matsakis 2013-02-26 14:37:31 -05:00
parent 65986ba0c0
commit cbfd88a486
13 changed files with 264 additions and 190 deletions

View file

@ -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]

View file

@ -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;