Add syntax and representation for return-by-mutably-rooted-ref

This will be used in the near future to decide what can safely
be done with the returned reference.

Issue #918
This commit is contained in:
Marijn Haverbeke 2011-09-14 17:18:48 +02:00
parent 1cabe37155
commit 93de2f0b74
11 changed files with 55 additions and 34 deletions

View file

@ -445,7 +445,7 @@ fn parse_ret_ty(p: parser) -> (ast::ret_style, @ast::ty) {
} else {
let style = ast::return_val;
if eat(p, token::BINOP(token::AND)) {
style = ast::return_ref;
style = ast::return_ref(eat(p, token::NOT));
};
(style, parse_ty(p, false))
}