diff options
| author | bors <bors@rust-lang.org> | 2013-10-21 05:21:27 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-21 05:21:27 -0700 |
| commit | 6e6981c3eb92ab87342ae9ccb3ead879fb7cbdb0 (patch) | |
| tree | 30b05697eda31411439c9a40918a9cfc2e38bfee /src/libsyntax | |
| parent | 04ac697f529136abec5e6e7cc888fef1afbf1c4b (diff) | |
| parent | c5346fea38ed391c7ea83b3d03354904f0f3bd39 (diff) | |
| download | rust-6e6981c3eb92ab87342ae9ccb3ead879fb7cbdb0.tar.gz rust-6e6981c3eb92ab87342ae9ccb3ead879fb7cbdb0.zip | |
auto merge of #9991 : LeoTestard/rust/asm-feature-gate, r=huonw
Fixes #9882 Note that the actual checking code is inside a if false in order to compile libstd properly. libstd uses asm! in rt. If we put ```#[feature(asm)]``` in libstd, it fails to build at stage0 beacause the asm feature is not known yet by the snapshot compiler. We must wait that this PR arrives into the snapshot in order to actually activate the checking code.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/visit.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 8d717611760..5d50833ff31 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -90,6 +90,7 @@ pub trait Visitor<E:Clone> { walk_struct_def(self, s, i, g, n, e) } fn visit_struct_field(&mut self, s:@struct_field, e:E) { walk_struct_field(self, s, e) } + fn visit_mac(&mut self, m:&mac, e:E) { walk_mac(self, m, e); } } impl<E:Clone> Visitor<E> for @mut Visitor<E> { @@ -150,6 +151,9 @@ impl<E:Clone> Visitor<E> for @mut Visitor<E> { fn visit_struct_field(&mut self, a:@struct_field, e:E) { (*self).visit_struct_field(a, e) } + fn visit_mac(&mut self, macro:&mac, e:E) { + (*self).visit_mac(macro, e); + } } pub fn walk_crate<E:Clone, V:Visitor<E>>(visitor: &mut V, crate: &Crate, env: E) { @@ -247,7 +251,7 @@ pub fn walk_item<E:Clone, V:Visitor<E>>(visitor: &mut V, item: &item, env: E) { visitor.visit_trait_method(method, env.clone()) } } - item_mac(ref macro) => walk_mac(visitor, macro, env), + item_mac(ref macro) => visitor.visit_mac(macro, env), } } @@ -507,7 +511,7 @@ pub fn walk_stmt<E:Clone, V:Visitor<E>>(visitor: &mut V, statement: &Stmt, env: StmtExpr(expression, _) | StmtSemi(expression, _) => { visitor.visit_expr(expression, env) } - StmtMac(ref macro, _) => walk_mac(visitor, macro, env), + StmtMac(ref macro, _) => visitor.visit_mac(macro, env), } } @@ -644,7 +648,7 @@ pub fn walk_expr<E:Clone, V:Visitor<E>>(visitor: &mut V, expression: @Expr, env: walk_expr_opt(visitor, optional_expression, env.clone()) } ExprLogLevel => {} - ExprMac(ref macro) => walk_mac(visitor, macro, env.clone()), + ExprMac(ref macro) => visitor.visit_mac(macro, env.clone()), ExprParen(subexpression) => { visitor.visit_expr(subexpression, env.clone()) } |
