Make &self permit explicit lifetimes, but don't really use them

(this will be needed for snapshotting at some point).
This commit is contained in:
Niko Matsakis
2013-03-09 19:43:53 -05:00
parent 087a015a72
commit a6187c62e9
13 changed files with 166 additions and 55 deletions

View File

@@ -1002,18 +1002,18 @@ impl to_bytes::IterBytes for ret_style {
#[auto_decode]
#[deriving_eq]
pub enum self_ty_ {
sty_static, // no self: static method
sty_by_ref, // old by-reference self: ``
sty_value, // by-value self: `self`
sty_region(mutability), // by-region self: `&self`
sty_box(mutability), // by-managed-pointer self: `@self`
sty_uniq(mutability) // by-unique-pointer self: `~self`
sty_static, // no self
sty_by_ref, // ``
sty_value, // `self`
sty_region(Option<@Lifetime>, mutability), // `&'lt self`
sty_box(mutability), // `@self`
sty_uniq(mutability) // `~self`
}
impl self_ty_ {
fn is_borrowed(&self) -> bool {
match *self {
sty_region(_) => true,
sty_region(*) => true,
_ => false
}
}