diff --git a/src/libcore/sys.rs b/src/libcore/sys.rs index f44f6f37985..bbcbd73aabd 100644 --- a/src/libcore/sys.rs +++ b/src/libcore/sys.rs @@ -22,14 +22,14 @@ use str; pub type FreeGlue = &self/fn(*TypeDesc, *c_void); // Corresponds to runtime type_desc type -pub enum TypeDesc = { +pub struct TypeDesc { size: uint, align: uint, take_glue: uint, drop_glue: uint, free_glue: uint // Remaining fields not listed -}; +} /// The representation of a Rust closure pub struct Closure { diff --git a/src/librustc/front/intrinsic.rs b/src/librustc/front/intrinsic.rs index cf5c0ffa19b..e7ffc6c55cb 100644 --- a/src/librustc/front/intrinsic.rs +++ b/src/librustc/front/intrinsic.rs @@ -22,11 +22,11 @@ pub mod intrinsic { } } - pub enum TyDesc = { + pub struct TyDesc { size: uint, align: uint // Remaining fields not listed - }; + } pub trait TyVisitor { fn visit_bot(&self) -> bool; diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index 4d874fc4ef9..9fc104f9400 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -36,13 +36,6 @@ use syntax::{ast, visit}; pub type parent = Option<ast::node_id>; -/* Records the parameter ID of a region name. */ -pub type binding = { - node_id: ast::node_id, - name: ~str, - br: ty::bound_region -}; - /** Encodes the bounding lifetime for a given AST node: diff --git a/src/librustc/middle/trans/machine.rs b/src/librustc/middle/trans/machine.rs index 8d447f54c20..434fcd4cf31 100644 --- a/src/librustc/middle/trans/machine.rs +++ b/src/librustc/middle/trans/machine.rs @@ -22,19 +22,6 @@ use util::ppaux::ty_to_str; // ______________________________________________________________________ // compute sizeof / alignof -pub type metrics = { - bcx: block, - sz: ValueRef, - align: ValueRef -}; - -pub type tag_metrics = { - bcx: block, - sz: ValueRef, - align: ValueRef, - payload_align: ValueRef -}; - // Returns the number of bytes clobbered by a Store to this type. pub fn llsize_of_store(cx: @CrateContext, t: TypeRef) -> uint { unsafe { diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 0cbc01deff2..aaa637fc2d5 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -775,7 +775,6 @@ type constness_cache = HashMap<ast::def_id, const_eval::constness>; pub type node_type_table = @mut SmallIntMap<t>; fn mk_rcache() -> creader_cache { - type val = {cnum: int, pos: uint, len: uint}; return oldmap::HashMap(); } diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index 95284e81003..1535156d96c 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -94,6 +94,12 @@ pub fn collect_item_types(ccx: @mut CrateCtxt, crate: @ast::crate) { (intrinsic_item.ident, (def_id, ty)); } + ast::item_struct(*) => { + let ty = ty::mk_struct(ccx.tcx, def_id, substs); + ccx.tcx.intrinsic_defs.insert + (intrinsic_item.ident, (def_id, ty)); + } + _ => {} } } diff --git a/src/librustdoc/demo.rs b/src/librustdoc/demo.rs index b823be95ef7..6a3a509ded4 100644 --- a/src/librustdoc/demo.rs +++ b/src/librustdoc/demo.rs @@ -26,9 +26,9 @@ use core::prelude::*; /// The base price of a muffin on a non-holiday const price_of_a_muffin: float = 70f; -type WaitPerson = { +struct WaitPerson { hair_color: ~str -}; +} /// The type of things that produce omnomnom enum OmNomNomy { diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 232c57eb5a2..1038982d353 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -217,7 +217,6 @@ pub struct FileLines { pub enum FileSubstr { pub FssNone, pub FssInternal(span), - pub FssExternal({filename: ~str, line: uint, col: CharPos}) } /// Identifies an offset of a multi-byte character in a FileMap @@ -348,12 +347,6 @@ pub impl CodeMap { FssInternal(sp) => self.lookup_char_pos_adj( sp.lo + (pos - loc.file.start_pos)), - FssExternal(ref eloc) => - LocWithOpt { - filename: /* FIXME (#2543) */ copy (*eloc).filename, - line: (*eloc).line + loc.line - 1u, - col: if loc.line == 1 {eloc.col + loc.col} else {loc.col}, - file: None} } } @@ -368,7 +361,6 @@ pub impl CodeMap { expn_info: sp.expn_info }) } - FssExternal(_) => sp } } diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index 93d3d952cdd..dbb44858761 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -49,6 +49,7 @@ pub enum ObsoleteSyntax { ObsoleteMutOwnedPointer, ObsoleteMutVector, ObsoleteTraitImplVisibility, + ObsoleteRecordType, } impl to_bytes::IterBytes for ObsoleteSyntax { @@ -145,6 +146,10 @@ pub impl Parser { because the `impl...for...` form defines overloads for \ methods that already exist; remove the `pub` or `priv`" ), + ObsoleteRecordType => ( + "structural record type", + "use a structure instead" + ), }; self.report(sp, kind, kind_str, desc); diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index eb9831cd9f3..cb4a2ce6920 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -75,6 +75,7 @@ use parse::obsolete::{ObsoleteSyntax, ObsoleteLowerCaseKindBounds}; use parse::obsolete::{ObsoleteUnsafeBlock, ObsoleteImplSyntax}; use parse::obsolete::{ObsoleteTraitBoundSeparator, ObsoleteMutOwnedPointer}; use parse::obsolete::{ObsoleteMutVector, ObsoleteTraitImplVisibility}; +use parse::obsolete::{ObsoleteRecordType}; use parse::prec::{as_prec, token_to_binop}; use parse::token::{can_begin_expr, is_ident, is_ident_or_path}; use parse::token::{is_plain_ident, INTERPOLATED, special_idents}; @@ -657,6 +658,7 @@ pub impl Parser { if elems.len() == 0 { self.unexpected_last(&token::RBRACE); } + self.obsolete(*self.last_span, ObsoleteRecordType); ty_rec(elems) } else if *self.token == token::LBRACKET { self.expect(&token::LBRACKET); diff --git a/src/test/run-pass/alignment-gep-tup-like-1.rs b/src/test/run-pass/alignment-gep-tup-like-1.rs index 0f19d4ee16b..d62c719edf1 100644 --- a/src/test/run-pass/alignment-gep-tup-like-1.rs +++ b/src/test/run-pass/alignment-gep-tup-like-1.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type pair<A,B> = { +struct pair<A,B> { a: A, b: B -}; +} fn f<A:Copy + &static>(a: A, b: u16) -> @fn() -> (A, u16) { let result: @fn() -> (A, u16) = || (a, b);