diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-05-05 15:11:04 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-05-05 15:11:04 -0400 |
| commit | 4300d4d2fa9d35ac73742c7d815ee157ce0f9c17 (patch) | |
| tree | 9e5db5a04493a573f280b2c8863d0eaf0ca47c0d /src/libsyntax/ast.rs | |
| parent | 6cb273ed4efb6724b1c713c3ac35d14e52999fb1 (diff) | |
| parent | 063851ffa1b8388a0b70446c0209af16264e8181 (diff) | |
| download | rust-4300d4d2fa9d35ac73742c7d815ee157ce0f9c17.tar.gz rust-4300d4d2fa9d35ac73742c7d815ee157ce0f9c17.zip | |
Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze
Conflicts: src/libcore/core.rc src/libcore/hashmap.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/num/float.rs src/libcore/num/int-template.rs src/libcore/num/num.rs src/libcore/num/strconv.rs src/libcore/num/uint-template.rs src/libcore/ops.rs src/libcore/os.rs src/libcore/prelude.rs src/libcore/rt/mod.rs src/libcore/unstable/lang.rs src/librustc/driver/session.rs src/librustc/middle/astencode.rs src/librustc/middle/borrowck/check_loans.rs src/librustc/middle/borrowck/gather_loans.rs src/librustc/middle/borrowck/loan.rs src/librustc/middle/borrowck/preserve.rs src/librustc/middle/liveness.rs src/librustc/middle/mem_categorization.rs src/librustc/middle/region.rs src/librustc/middle/trans/base.rs src/librustc/middle/trans/inline.rs src/librustc/middle/trans/reachable.rs src/librustc/middle/typeck/check/_match.rs src/librustc/middle/typeck/check/regionck.rs src/librustc/util/ppaux.rs src/libstd/arena.rs src/libstd/ebml.rs src/libstd/json.rs src/libstd/serialize.rs src/libstd/std.rc src/libsyntax/ast_map.rs src/libsyntax/parse/parser.rs src/test/compile-fail/borrowck-uniq-via-box.rs src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs src/test/run-pass/borrowck-nested-calls.rs
Diffstat (limited to 'src/libsyntax/ast.rs')
| -rw-r--r-- | src/libsyntax/ast.rs | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index ba6fe1cda4f..2216226ecb3 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -71,20 +71,21 @@ pub type Name = uint; pub type Mrk = uint; impl<S:Encoder> Encodable<S> for ident { - fn encode(&self, s: &S) { - let intr = match unsafe { - task::local_data::local_data_get(interner_key!()) - } { - None => fail!(~"encode: TLS interner not set up"), - Some(intr) => intr - }; - - s.emit_str(*(*intr).get(*self)); + fn encode(&self, s: &mut S) { + unsafe { + let intr = + match task::local_data::local_data_get(interner_key!()) { + None => fail!(~"encode: TLS interner not set up"), + Some(intr) => intr + }; + + s.emit_str(*(*intr).get(*self)); + } } } impl<D:Decoder> Decodable<D> for ident { - fn decode(d: &D) -> ident { + fn decode(d: &mut D) -> ident { let intr = match unsafe { task::local_data::local_data_get(interner_key!()) } { @@ -389,7 +390,7 @@ pub enum binop { add, subtract, mul, - quot, + div, rem, and, or, @@ -1158,6 +1159,7 @@ pub struct struct_field_ { kind: struct_field_kind, id: node_id, ty: @Ty, + attrs: ~[attribute], } pub type struct_field = spanned<struct_field_>; @@ -1174,10 +1176,7 @@ pub enum struct_field_kind { #[auto_decode] #[deriving(Eq)] pub struct struct_def { - fields: ~[@struct_field], /* fields */ - /* (not including ctor or dtor) */ - /* dtor is optional */ - dtor: Option<struct_dtor>, + fields: ~[@struct_field], /* fields, not including ctor */ /* ID of the constructor. This is only used for tuple- or enum-like * structs. */ ctor_id: Option<node_id> @@ -1230,18 +1229,6 @@ impl to_bytes::IterBytes for struct_mutability { } } -pub type struct_dtor = spanned<struct_dtor_>; - -#[auto_encode] -#[auto_decode] -#[deriving(Eq)] -pub struct struct_dtor_ { - id: node_id, - attrs: ~[attribute], - self_id: node_id, - body: blk, -} - #[auto_encode] #[auto_decode] #[deriving(Eq)] @@ -1272,7 +1259,6 @@ pub enum inlined_item { ii_item(@item), ii_method(def_id /* impl id */, @method), ii_foreign(@foreign_item), - ii_dtor(struct_dtor, ident, Generics, def_id /* parent id */) } /* hold off on tests ... they appear in a later merge. @@ -1361,12 +1347,3 @@ mod test { } */ -// -// Local Variables: -// mode: rust -// fill-column: 78; -// indent-tabs-mode: nil -// c-basic-offset: 4 -// buffer-file-coding-system: utf-8-unix -// End: -// |
