Skip to content

Commit 7f3b1bb

Browse files
committed
---
yaml --- r: 139410 b: refs/heads/try2 c: 943d7ad h: refs/heads/master v: v3
1 parent 33814d4 commit 7f3b1bb

File tree

25 files changed

+49
-353
lines changed

25 files changed

+49
-353
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: e2ba58cd50c5ea96cb2babc66b694476a9c93dab
8+
refs/heads/try2: 943d7adedc2401b54e103ea3635d0e50b1822d5a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ then
533533
LLVM_VERSION=$($LLVM_CONFIG --version)
534534

535535
case $LLVM_VERSION in
536-
(3.1svn|3.1|3.0svn|3.0)
536+
(3.2svn|3.2|3.1svn|3.1|3.0svn|3.0)
537537
msg "found ok version of LLVM: $LLVM_VERSION"
538538
;;
539539
(*)

branches/try2/src/libcore/str.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,8 @@ pub fn each_split_within<'a>(ss: &'a str,
726726

727727
(B, Cr, UnderLim) => { B }
728728
(B, Cr, OverLim) if (i - last_start + 1) > lim
729-
=> { fail!(~"word longer than limit!") }
729+
=> fail!(fmt!("word starting with %? longer than limit!",
730+
self::slice(ss, last_start, i + 1))),
730731
(B, Cr, OverLim) => { slice(); slice_start = last_start; B }
731732
(B, Ws, UnderLim) => { last_end = i; C }
732733
(B, Ws, OverLim) => { last_end = i; slice(); A }

branches/try2/src/libcore/unstable/extfmt.rs

Lines changed: 0 additions & 189 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,6 @@ pub mod ct {
470470
// decisions made a runtime. If it proves worthwhile then some of these
471471
// conditions can be evaluated at compile-time. For now though it's cleaner to
472472
// implement it this way, I think.
473-
#[cfg(stage1)]
474-
#[cfg(stage2)]
475-
#[cfg(stage3)]
476473
#[doc(hidden)]
477474
pub mod rt {
478475
use float;
@@ -676,192 +673,6 @@ pub mod rt {
676673
}
677674
}
678675
679-
// XXX: remove after a snapshot of the above changes have gone in
680-
#[cfg(stage0)]
681-
#[doc(hidden)]
682-
pub mod rt {
683-
use float;
684-
use str;
685-
use sys;
686-
use uint;
687-
use vec;
688-
689-
pub static flag_none : u32 = 0u32;
690-
pub static flag_left_justify : u32 = 0b00000000000001u32;
691-
pub static flag_left_zero_pad : u32 = 0b00000000000010u32;
692-
pub static flag_space_for_sign : u32 = 0b00000000000100u32;
693-
pub static flag_sign_always : u32 = 0b00000000001000u32;
694-
pub static flag_alternate : u32 = 0b00000000010000u32;
695-
696-
pub enum Count { CountIs(uint), CountImplied, }
697-
698-
pub enum Ty { TyDefault, TyBits, TyHexUpper, TyHexLower, TyOctal, }
699-
700-
pub struct Conv {
701-
flags: u32,
702-
width: Count,
703-
precision: Count,
704-
ty: Ty,
705-
}
706-
707-
pub fn conv_int(cv: Conv, i: int) -> ~str {
708-
let radix = 10;
709-
let prec = get_int_precision(cv);
710-
let mut s : ~str = int_to_str_prec(i, radix, prec);
711-
if 0 <= i {
712-
if have_flag(cv.flags, flag_sign_always) {
713-
unsafe { str::unshift_char(&mut s, '+') };
714-
} else if have_flag(cv.flags, flag_space_for_sign) {
715-
unsafe { str::unshift_char(&mut s, ' ') };
716-
}
717-
}
718-
return unsafe { pad(cv, s, PadSigned) };
719-
}
720-
pub fn conv_uint(cv: Conv, u: uint) -> ~str {
721-
let prec = get_int_precision(cv);
722-
let mut rs =
723-
match cv.ty {
724-
TyDefault => uint_to_str_prec(u, 10, prec),
725-
TyHexLower => uint_to_str_prec(u, 16, prec),
726-
TyHexUpper => str::to_upper(uint_to_str_prec(u, 16, prec)),
727-
TyBits => uint_to_str_prec(u, 2, prec),
728-
TyOctal => uint_to_str_prec(u, 8, prec)
729-
};
730-
return unsafe { pad(cv, rs, PadUnsigned) };
731-
}
732-
pub fn conv_bool(cv: Conv, b: bool) -> ~str {
733-
let s = if b { ~"true" } else { ~"false" };
734-
// run the boolean conversion through the string conversion logic,
735-
// giving it the same rules for precision, etc.
736-
return conv_str(cv, s);
737-
}
738-
pub fn conv_char(cv: Conv, c: char) -> ~str {
739-
let mut s = str::from_char(c);
740-
return unsafe { pad(cv, s, PadNozero) };
741-
}
742-
pub fn conv_str(cv: Conv, s: &str) -> ~str {
743-
// For strings, precision is the maximum characters
744-
// displayed
745-
let mut unpadded = match cv.precision {
746-
CountImplied => s.to_owned(),
747-
CountIs(max) => if (max as uint) < str::char_len(s) {
748-
str::substr(s, 0, max as uint).to_owned()
749-
} else {
750-
s.to_owned()
751-
}
752-
};
753-
return unsafe { pad(cv, unpadded, PadNozero) };
754-
}
755-
pub fn conv_float(cv: Conv, f: float) -> ~str {
756-
let (to_str, digits) = match cv.precision {
757-
CountIs(c) => (float::to_str_exact, c as uint),
758-
CountImplied => (float::to_str_digits, 6u)
759-
};
760-
let mut s = unsafe { to_str(f, digits) };
761-
if 0.0 <= f {
762-
if have_flag(cv.flags, flag_sign_always) {
763-
s = ~"+" + s;
764-
} else if have_flag(cv.flags, flag_space_for_sign) {
765-
s = ~" " + s;
766-
}
767-
}
768-
return unsafe { pad(cv, s, PadFloat) };
769-
}
770-
pub fn conv_poly<T>(cv: Conv, v: &T) -> ~str {
771-
let s = sys::log_str(v);
772-
return conv_str(cv, s);
773-
}
774-
775-
// Convert an int to string with minimum number of digits. If precision is
776-
// 0 and num is 0 then the result is the empty string.
777-
pub fn int_to_str_prec(num: int, radix: uint, prec: uint) -> ~str {
778-
return if num < 0 {
779-
~"-" + uint_to_str_prec(-num as uint, radix, prec)
780-
} else { uint_to_str_prec(num as uint, radix, prec) };
781-
}
782-
783-
// Convert a uint to string with a minimum number of digits. If precision
784-
// is 0 and num is 0 then the result is the empty string. Could move this
785-
// to uint: but it doesn't seem all that useful.
786-
pub fn uint_to_str_prec(num: uint, radix: uint,
787-
prec: uint) -> ~str {
788-
return if prec == 0u && num == 0u {
789-
~""
790-
} else {
791-
let s = uint::to_str_radix(num, radix);
792-
let len = str::char_len(s);
793-
if len < prec {
794-
let diff = prec - len;
795-
let pad = str::from_chars(vec::from_elem(diff, '0'));
796-
pad + s
797-
} else { s }
798-
};
799-
}
800-
pub fn get_int_precision(cv: Conv) -> uint {
801-
return match cv.precision {
802-
CountIs(c) => c as uint,
803-
CountImplied => 1u
804-
};
805-
}
806-
807-
#[deriving(Eq)]
808-
pub enum PadMode { PadSigned, PadUnsigned, PadNozero, PadFloat }
809-
810-
pub fn pad(cv: Conv, s: ~str, mode: PadMode) -> ~str {
811-
let mut s = s; // sadtimes
812-
let uwidth : uint = match cv.width {
813-
CountImplied => return (s),
814-
CountIs(width) => { width as uint }
815-
};
816-
let strlen = str::char_len(s);
817-
if uwidth <= strlen { return (s); }
818-
let mut padchar = ' ';
819-
let diff = uwidth - strlen;
820-
if have_flag(cv.flags, flag_left_justify) {
821-
let padstr = str::from_chars(vec::from_elem(diff, padchar));
822-
return s + padstr;
823-
}
824-
let (might_zero_pad, signed) = match mode {
825-
PadNozero => (false, true),
826-
PadSigned => (true, true),
827-
PadFloat => (true, true),
828-
PadUnsigned => (true, false)
829-
};
830-
fn have_precision(cv: Conv) -> bool {
831-
return match cv.precision { CountImplied => false, _ => true };
832-
}
833-
let zero_padding = {
834-
if might_zero_pad && have_flag(cv.flags, flag_left_zero_pad) &&
835-
(!have_precision(cv) || mode == PadFloat) {
836-
padchar = '0';
837-
true
838-
} else {
839-
false
840-
}
841-
};
842-
let padstr = str::from_chars(vec::from_elem(diff, padchar));
843-
// This is completely heinous. If we have a signed value then
844-
// potentially rip apart the intermediate result and insert some
845-
// zeros. It may make sense to convert zero padding to a precision
846-
// instead.
847-
848-
if signed && zero_padding && s.len() > 0 {
849-
let head = str::shift_char(&mut s);
850-
if head == '+' || head == '-' || head == ' ' {
851-
let headstr = str::from_chars(vec::from_elem(1u, head));
852-
return headstr + padstr + s;
853-
}
854-
else {
855-
str::unshift_char(&mut s, head);
856-
}
857-
}
858-
return padstr + s;
859-
}
860-
pub fn have_flag(flags: u32, f: u32) -> bool {
861-
flags & f != 0
862-
}
863-
}
864-
865676
// Bulk of the tests are in src/test/run-pass/syntax-extension-fmt.rs
866677
#[cfg(test)]
867678
mod test {

branches/try2/src/librustc/driver/driver.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,7 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
762762
optflag(~"", ~"test", ~"Build a test harness"),
763763
optopt(~"", ~"target",
764764
~"Target triple cpu-manufacturer-kernel[-os]
765-
to compile for (see
766-
http://sources.redhat.com/autobook/autobook/autobook_17.html
765+
to compile for (see chapter 3.4 of http://www.sourceware.org/autobook/
767766
for detail)", ~"TRIPLE"),
768767
optopt(~"", ~"android-cross-path",
769768
~"The path to the Android NDK", "PATH"),

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ fn encode_enum_variant_info(ecx: @EncodeContext, ebml_w: writer::Encoder,
286286
if args.len() > 0 && generics.ty_params.len() == 0 => {
287287
encode_symbol(ecx, ebml_w, variant.node.id);
288288
}
289-
ast::tuple_variant_kind(_) | ast::struct_variant_kind(_) |
290-
ast::enum_variant_kind(_) => {}
289+
ast::tuple_variant_kind(_) | ast::struct_variant_kind(_) => {}
291290
}
292291
encode_discriminant(ecx, ebml_w, variant.node.id);
293292
if vi[i].disr_val != disr_val {

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use syntax::ast::{expr_binary, expr_break, expr_cast, expr_field};
3737
use syntax::ast::{expr_fn_block, expr_index, expr_method_call, expr_path};
3838
use syntax::ast::{def_prim_ty, def_region, def_self, def_ty, def_ty_param};
3939
use syntax::ast::{def_upvar, def_use, def_variant, div, eq};
40-
use syntax::ast::{enum_variant_kind, expr, expr_again, expr_assign_op};
40+
use syntax::ast::{expr, expr_again, expr_assign_op};
4141
use syntax::ast::{expr_index, expr_loop};
4242
use syntax::ast::{expr_path, expr_struct, expr_unary, fn_decl};
4343
use syntax::ast::{foreign_item, foreign_item_const, foreign_item_fn, ge};
@@ -1383,16 +1383,6 @@ pub impl Resolver {
13831383
variant.span);
13841384
self.structs.insert(local_def(variant.node.id));
13851385
}
1386-
enum_variant_kind(ref enum_definition) => {
1387-
child.define_type(privacy,
1388-
def_ty(local_def(variant.node.id)),
1389-
variant.span);
1390-
for (*enum_definition).variants.each |variant| {
1391-
self.build_reduced_graph_for_variant(*variant, item_id,
1392-
parent_privacy,
1393-
parent, visitor);
1394-
}
1395-
}
13961386
}
13971387
}
13981388

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,14 +2051,6 @@ pub fn trans_enum_def(ccx: @CrateContext, enum_definition: ast::enum_def,
20512051
trans_struct_def(ccx, struct_def, path,
20522052
variant.node.id);
20532053
}
2054-
ast::enum_variant_kind(ref enum_definition) => {
2055-
trans_enum_def(ccx,
2056-
*enum_definition,
2057-
id,
2058-
path,
2059-
vi,
2060-
&mut *i);
2061-
}
20622054
}
20632055
}
20642056
}
@@ -2513,9 +2505,6 @@ pub fn get_item_val(ccx: @CrateContext, id: ast::node_id) -> ValueRef {
25132505
ast::struct_variant_kind(_) => {
25142506
fail!(~"struct variant kind unexpected in get_item_val")
25152507
}
2516-
ast::enum_variant_kind(_) => {
2517-
fail!(~"enum variant kind unexpected in get_item_val")
2518-
}
25192508
}
25202509
set_inline_hint(llfn);
25212510
llfn

branches/try2/src/librustc/middle/trans/monomorphize.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,6 @@ pub fn monomorphic_fn(ccx: @CrateContext,
204204
}
205205
ast::struct_variant_kind(_) =>
206206
ccx.tcx.sess.bug(~"can't monomorphize struct variants"),
207-
ast::enum_variant_kind(_) =>
208-
ccx.tcx.sess.bug(~"can't monomorphize enum variants")
209207
}
210208
d
211209
}

branches/try2/src/librustc/middle/ty.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3873,9 +3873,6 @@ pub fn enum_variants(cx: ctxt, id: ast::def_id) -> @~[VariantInfo] {
38733873
ast::struct_variant_kind(_) => {
38743874
fail!(~"struct variant kinds unimpl in enum_variants")
38753875
}
3876-
ast::enum_variant_kind(_) => {
3877-
fail!(~"enum variant kinds unimpl in enum_variants")
3878-
}
38793876
}
38803877
})
38813878
}

branches/try2/src/librustc/middle/typeck/check/mod.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,16 +3066,6 @@ pub fn check_enum_variants(ccx: @mut CrateCtxt,
30663066
ccx.tcx, local_def(v.node.id)).map(|cf|
30673067
ty::node_id_to_type(ccx.tcx, cf.id.node)));
30683068
}
3069-
ast::enum_variant_kind(_) => {
3070-
arg_tys = None;
3071-
do_check(ccx,
3072-
sp,
3073-
vs,
3074-
id,
3075-
&mut *disr_vals,
3076-
&mut *disr_val,
3077-
&mut *variants);
3078-
}
30793069
}
30803070

30813071
match arg_tys {

branches/try2/src/librustc/middle/typeck/collect.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,6 @@ pub fn get_enum_variant_types(ccx: &CrateCtxt,
202202
|f| ty::node_id_to_type(ccx.tcx, f.node.id));
203203
result_ty = Some(ty::mk_ctor_fn(tcx, input_tys, enum_ty));
204204
}
205-
206-
ast::enum_variant_kind(ref enum_definition) => {
207-
get_enum_variant_types(ccx,
208-
enum_ty,
209-
enum_definition.variants,
210-
generics,
211-
rp);
212-
result_ty = None;
213-
}
214205
};
215206

216207
match result_ty {

branches/try2/src/libsyntax/ast.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,15 +1078,13 @@ pub struct variant_arg {
10781078
pub enum variant_kind {
10791079
tuple_variant_kind(~[variant_arg]),
10801080
struct_variant_kind(@struct_def),
1081-
enum_variant_kind(enum_def)
10821081
}
10831082
10841083
#[auto_encode]
10851084
#[auto_decode]
10861085
#[deriving(Eq)]
10871086
pub struct enum_def {
10881087
variants: ~[variant],
1089-
common: Option<@struct_def>,
10901088
}
10911089
10921090
#[auto_encode]

branches/try2/src/libsyntax/ext/auto_encode.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,6 @@ fn mk_enum_ser_body(
990990
),
991991
ast::struct_variant_kind(*) =>
992992
fail!(~"struct variants unimplemented"),
993-
ast::enum_variant_kind(*) =>
994-
fail!(~"enum variants unimplemented"),
995993
}
996994
};
997995
@@ -1089,8 +1087,6 @@ fn mk_enum_deser_body(
10891087
},
10901088
ast::struct_variant_kind(*) =>
10911089
fail!(~"struct variants unimplemented"),
1092-
ast::enum_variant_kind(*) =>
1093-
fail!(~"enum variants unimplemented")
10941090
};
10951091
10961092
let pat = @ast::pat {

branches/try2/src/libsyntax/ext/deriving/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use core::prelude::*;
1212

1313
use ast;
1414
use ast::{TraitTyParamBound, Ty, and, bind_by_ref, binop, deref, enum_def};
15-
use ast::{enum_variant_kind, expr, expr_match, ident, impure_fn, item, item_};
15+
use ast::{expr, expr_match, ident, impure_fn, item, item_};
1616
use ast::{item_enum, item_impl, item_struct, Generics};
1717
use ast::{m_imm, meta_item, method};
1818
use ast::{named_field, or, pat, pat_ident, pat_wild, public, pure_fn};

0 commit comments

Comments
 (0)