Temporary bootstrapping hack: introduce syntax for r egion bounds like 'b:'a
,
meaning `'b outlives 'a`. Syntax currently does nothing but is needed for full fix to #5763. To use this syntax, the issue_5763_bootstrap feature guard is required.
This commit is contained in:
parent
1a53c00117
commit
fcab98038c
19 changed files with 241 additions and 81 deletions
|
@ -73,6 +73,11 @@ pub trait AstBuilder {
|
|||
fn trait_ref(&self, path: ast::Path) -> ast::TraitRef;
|
||||
fn typarambound(&self, path: ast::Path) -> ast::TyParamBound;
|
||||
fn lifetime(&self, span: Span, ident: ast::Name) -> ast::Lifetime;
|
||||
fn lifetime_def(&self,
|
||||
span: Span,
|
||||
name: ast::Name,
|
||||
bounds: Vec<ast::Lifetime>)
|
||||
-> ast::LifetimeDef;
|
||||
|
||||
// statements
|
||||
fn stmt_expr(&self, expr: Gc<ast::Expr>) -> Gc<ast::Stmt>;
|
||||
|
@ -456,6 +461,17 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
|||
ast::Lifetime { id: ast::DUMMY_NODE_ID, span: span, name: name }
|
||||
}
|
||||
|
||||
fn lifetime_def(&self,
|
||||
span: Span,
|
||||
name: ast::Name,
|
||||
bounds: Vec<ast::Lifetime>)
|
||||
-> ast::LifetimeDef {
|
||||
ast::LifetimeDef {
|
||||
lifetime: self.lifetime(span, name),
|
||||
bounds: bounds
|
||||
}
|
||||
}
|
||||
|
||||
fn stmt_expr(&self, expr: Gc<ast::Expr>) -> Gc<ast::Stmt> {
|
||||
box(GC) respan(expr.span, ast::StmtSemi(expr, ast::DUMMY_NODE_ID))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue