diff options
| author | bors <bors@rust-lang.org> | 2013-09-11 14:56:00 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-09-11 14:56:00 -0700 |
| commit | 7f0d261ae2d931a8a3e06d784840d85e25166d89 (patch) | |
| tree | b8bc39c2b74473ac60485d55539381fee9a29ffe /src/libsyntax | |
| parent | c8f69dd2a4cf80f98e1a1ad37febb4cc9948f5ee (diff) | |
| parent | 0766c89b423d91e36d3f3ce0abcb3971a42d258e (diff) | |
| download | rust-7f0d261ae2d931a8a3e06d784840d85e25166d89.tar.gz rust-7f0d261ae2d931a8a3e06d784840d85e25166d89.zip | |
auto merge of #9064 : SiegeLord/rust/external_struct_variants, r=luqmana
Fixes issues #5557 and #8746. This patch adds an additional family for struct-like variants, and encodes some struct-like aspects of such variants that can then be properly decoded by resolve. Note that I am not 100% sure how this fix works, but it fixes the issue without breaking any of the tests on my machine.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ast_util.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index ef2e557b6ea..f5de683cb97 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -233,7 +233,7 @@ pub enum Def { DefStatic(DefId, bool /* is_mutbl */), DefArg(NodeId, bool /* is_mutbl */), DefLocal(NodeId, bool /* is_mutbl */), - DefVariant(DefId /* enum */, DefId /* variant */), + DefVariant(DefId /* enum */, DefId /* variant */, bool /* is_structure */), DefTy(DefId), DefTrait(DefId), DefPrimTy(prim_ty), diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 040c4cda4c7..965f4a49aec 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -52,7 +52,7 @@ pub fn stmt_id(s: &Stmt) -> NodeId { pub fn variant_def_ids(d: Def) -> Option<(DefId, DefId)> { match d { - DefVariant(enum_id, var_id) => { + DefVariant(enum_id, var_id, _) => { Some((enum_id, var_id)) } _ => None @@ -63,7 +63,7 @@ pub fn def_id_of_def(d: Def) -> DefId { match d { DefFn(id, _) | DefStaticMethod(id, _, _) | DefMod(id) | DefForeignMod(id) | DefStatic(id, _) | - DefVariant(_, id) | DefTy(id) | DefTyParam(id, _) | + DefVariant(_, id, _) | DefTy(id) | DefTyParam(id, _) | DefUse(id) | DefStruct(id) | DefTrait(id) | DefMethod(id, _) => { id } |
