1
Fork 0

auto merge of #5426 : nikomatsakis/rust/issue-4846-lifetimes-in-expl-self, r=pcwalton

(this will be needed for snapshotting at some point)

r? @pcwalton
This commit is contained in:
bors 2013-03-19 12:43:14 -07:00
commit e1888948c6
13 changed files with 166 additions and 55 deletions

View file

@ -1647,17 +1647,20 @@ pub fn print_pat(s: @ps, &&pat: @ast::pat, refutable: bool) {
// Returns whether it printed anything
pub fn print_self_ty(s: @ps, self_ty: ast::self_ty_) -> bool {
match self_ty {
ast::sty_static | ast::sty_by_ref => { return false; }
ast::sty_value => { word(s.s, ~"self"); }
ast::sty_region(m) => {
word(s.s, ~"&"); print_mutability(s, m); word(s.s, ~"self");
}
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");
}
ast::sty_static | ast::sty_by_ref => { return false; }
ast::sty_value => { word(s.s, ~"self"); }
ast::sty_region(lt, m) => {
word(s.s, ~"&");
print_opt_lifetime(s, lt);
print_mutability(s, m);
word(s.s, ~"self");
}
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;
}