Skip to content

Commit 66b8f13

Browse files
committed
---
yaml --- r: 38910 b: refs/heads/incoming c: 4c68084 h: refs/heads/master v: v3
1 parent 6ceb3e7 commit 66b8f13

29 files changed

+99
-398
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: fe02814a63bd759f6727c7479fc4aeb04f0be9b4
9+
refs/heads/incoming: 4c680849638b548e7202ebe4cbce2c86fd65519a
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/librustc/metadata/tyencode.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,6 @@ fn enc_sty(w: io::Writer, cx: @ctxt, st: ty::sty) {
286286
w.write_char('I');
287287
w.write_uint(id.to_uint());
288288
}
289-
ty::ty_infer(ty::FloatVar(id)) => {
290-
w.write_char('X');
291-
w.write_char('F');
292-
w.write_uint(id.to_uint());
293-
}
294289
ty::ty_param({idx: id, def_id: did}) => {
295290
w.write_char('p');
296291
w.write_str(cx.ds(did));

branches/incoming/src/librustc/middle/const_eval.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,6 @@ fn lit_to_const(lit: @lit) -> const_val {
389389
lit_uint(n, _) => const_uint(n),
390390
lit_int_unsuffixed(n) => const_int(n),
391391
lit_float(n, _) => const_float(float::from_str(*n).get() as f64),
392-
lit_float_unsuffixed(n) =>
393-
const_float(float::from_str(*n).get() as f64),
394392
lit_nil => const_int(0i64),
395393
lit_bool(b) => const_bool(b)
396394
}

branches/incoming/src/librustc/middle/trans/consts.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@ fn const_lit(cx: @crate_ctxt, e: @ast::expr, lit: ast::lit)
2222
}
2323
}
2424
ast::lit_float(fs, t) => C_floating(*fs, T_float_ty(cx, t)),
25-
ast::lit_float_unsuffixed(fs) => {
26-
let lit_float_ty = ty::node_id_to_type(cx.tcx, e.id);
27-
match ty::get(lit_float_ty).sty {
28-
ty::ty_float(t) => {
29-
C_floating(*fs, T_float_ty(cx, t))
30-
}
31-
_ => {
32-
cx.sess.span_bug(lit.span,
33-
~"floating point literal doesn't have the right \
34-
type");
35-
}
36-
}
37-
}
3825
ast::lit_bool(b) => C_bool(b),
3926
ast::lit_nil => C_nil(),
4027
ast::lit_str(s) => C_estr_slice(cx, *s)

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

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use util::ppaux::{ty_to_str, proto_ty_to_str, tys_to_str};
2121

2222
export ProvidedMethodSource;
2323
export InstantiatedTraitRef;
24-
export TyVid, IntVid, FloatVid, FnVid, RegionVid, vid;
24+
export TyVid, IntVid, FnVid, RegionVid, vid;
2525
export br_hashmap;
2626
export is_instantiable;
2727
export node_id_to_type;
@@ -86,7 +86,6 @@ export ty_fn, FnTy, FnTyBase, FnMeta, FnSig, mk_fn;
8686
export ty_fn_proto, ty_fn_purity, ty_fn_ret, ty_fn_ret_style, tys_in_fn_ty;
8787
export ty_int, mk_int, mk_mach_int, mk_char;
8888
export mk_i8, mk_u8, mk_i16, mk_u16, mk_i32, mk_u32, mk_i64, mk_u64;
89-
export mk_f32, mk_f64;
9089
export ty_estr, mk_estr, type_is_str;
9190
export ty_evec, mk_evec, type_is_vec;
9291
export ty_unboxed_vec, mk_unboxed_vec, mk_mut_unboxed_vec;
@@ -103,8 +102,8 @@ export ty_tup, mk_tup;
103102
export ty_type, mk_type;
104103
export ty_uint, mk_uint, mk_mach_uint;
105104
export ty_uniq, mk_uniq, mk_imm_uniq, type_is_unique_box;
106-
export ty_infer, mk_infer, type_is_ty_var, mk_var, mk_int_var, mk_float_var;
107-
export InferTy, TyVar, IntVar, FloatVar;
105+
export ty_infer, mk_infer, type_is_ty_var, mk_var, mk_int_var;
106+
export InferTy, TyVar, IntVar;
108107
export ty_self, mk_self, type_has_self;
109108
export ty_class;
110109
export Region, bound_region, encl_region;
@@ -173,8 +172,7 @@ export ty_sort_str;
173172
export normalize_ty;
174173
export to_str;
175174
export bound_const;
176-
export terr_no_integral_type, terr_no_floating_point_type;
177-
export terr_ty_param_size, terr_self_substs;
175+
export terr_no_integral_type, terr_ty_param_size, terr_self_substs;
178176
export terr_in_field, terr_record_fields, terr_vstores_differ, terr_arg_count;
179177
export terr_sorts, terr_vec, terr_str, terr_record_size, terr_tuple_size;
180178
export terr_regions_does_not_outlive, terr_mutability, terr_purity_mismatch;
@@ -668,7 +666,6 @@ enum type_err {
668666
terr_sorts(expected_found<t>),
669667
terr_self_substs,
670668
terr_no_integral_type,
671-
terr_no_floating_point_type,
672669
}
673670

674671
enum param_bound {
@@ -681,24 +678,21 @@ enum param_bound {
681678

682679
enum TyVid = uint;
683680
enum IntVid = uint;
684-
enum FloatVid = uint;
685681
enum FnVid = uint;
686682
#[auto_serialize]
687683
#[auto_deserialize]
688684
enum RegionVid = uint;
689685

690686
enum InferTy {
691687
TyVar(TyVid),
692-
IntVar(IntVid),
693-
FloatVar(FloatVid)
688+
IntVar(IntVid)
694689
}
695690

696691
impl InferTy : to_bytes::IterBytes {
697692
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
698693
match self {
699694
TyVar(ref tv) => to_bytes::iter_bytes_2(&0u8, tv, lsb0, f),
700-
IntVar(ref iv) => to_bytes::iter_bytes_2(&1u8, iv, lsb0, f),
701-
FloatVar(ref fv) => to_bytes::iter_bytes_2(&2u8, fv, lsb0, f)
695+
IntVar(ref iv) => to_bytes::iter_bytes_2(&1u8, iv, lsb0, f)
702696
}
703697
}
704698
}
@@ -764,11 +758,6 @@ impl IntVid: vid {
764758
pure fn to_str() -> ~str { fmt!("<VI%u>", self.to_uint()) }
765759
}
766760

767-
impl FloatVid: vid {
768-
pure fn to_uint() -> uint { *self }
769-
pure fn to_str() -> ~str { fmt!("<VF%u>", self.to_uint()) }
770-
}
771-
772761
impl FnVid: vid {
773762
pure fn to_uint() -> uint { *self }
774763
pure fn to_str() -> ~str { fmt!("<F%u>", self.to_uint()) }
@@ -784,15 +773,13 @@ impl InferTy {
784773
match self {
785774
TyVar(v) => v.to_uint() << 1,
786775
IntVar(v) => (v.to_uint() << 1) + 1,
787-
FloatVar(v) => (v.to_uint() << 1) + 2
788776
}
789777
}
790778

791779
pure fn to_str() -> ~str {
792780
match self {
793781
TyVar(v) => v.to_str(),
794782
IntVar(v) => v.to_str(),
795-
FloatVar(v) => v.to_str()
796783
}
797784
}
798785
}
@@ -825,12 +812,6 @@ impl IntVid : to_bytes::IterBytes {
825812
}
826813
}
827814

828-
impl FloatVid : to_bytes::IterBytes {
829-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
830-
(*self).iter_bytes(lsb0, f)
831-
}
832-
}
833-
834815
impl FnVid : to_bytes::IterBytes {
835816
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
836817
(*self).iter_bytes(lsb0, f)
@@ -1049,10 +1030,6 @@ fn mk_u32(cx: ctxt) -> t { mk_t(cx, ty_uint(ast::ty_u32)) }
10491030

10501031
fn mk_u64(cx: ctxt) -> t { mk_t(cx, ty_uint(ast::ty_u64)) }
10511032

1052-
fn mk_f32(cx: ctxt) -> t { mk_t(cx, ty_float(ast::ty_f32)) }
1053-
1054-
fn mk_f64(cx: ctxt) -> t { mk_t(cx, ty_float(ast::ty_f64)) }
1055-
10561033
fn mk_mach_int(cx: ctxt, tm: ast::int_ty) -> t { mk_t(cx, ty_int(tm)) }
10571034

10581035
fn mk_mach_uint(cx: ctxt, tm: ast::uint_ty) -> t { mk_t(cx, ty_uint(tm)) }
@@ -1133,9 +1110,9 @@ fn mk_class(cx: ctxt, class_id: ast::def_id, +substs: substs) -> t {
11331110

11341111
fn mk_var(cx: ctxt, v: TyVid) -> t { mk_infer(cx, TyVar(v)) }
11351112

1136-
fn mk_int_var(cx: ctxt, v: IntVid) -> t { mk_infer(cx, IntVar(v)) }
1137-
1138-
fn mk_float_var(cx: ctxt, v: FloatVid) -> t { mk_infer(cx, FloatVar(v)) }
1113+
fn mk_int_var(cx: ctxt, v: IntVid) -> t {
1114+
mk_infer(cx, IntVar(v))
1115+
}
11391116

11401117
fn mk_infer(cx: ctxt, it: InferTy) -> t { mk_t(cx, ty_infer(it)) }
11411118

@@ -1684,8 +1661,7 @@ pure fn type_is_unique(ty: t) -> bool {
16841661
pure fn type_is_scalar(ty: t) -> bool {
16851662
match get(ty).sty {
16861663
ty_nil | ty_bool | ty_int(_) | ty_float(_) | ty_uint(_) |
1687-
ty_infer(IntVar(_)) | ty_infer(FloatVar(_)) | ty_type |
1688-
ty_ptr(_) => true,
1664+
ty_infer(IntVar(_)) | ty_type | ty_ptr(_) => true,
16891665
_ => false
16901666
}
16911667
}
@@ -2452,7 +2428,7 @@ fn type_is_integral(ty: t) -> bool {
24522428
24532429
fn type_is_fp(ty: t) -> bool {
24542430
match get(ty).sty {
2455-
ty_infer(FloatVar(_)) | ty_float(_) => true,
2431+
ty_float(_) => true,
24562432
_ => false
24572433
}
24582434
}
@@ -3284,7 +3260,6 @@ fn ty_sort_str(cx: ctxt, t: t) -> ~str {
32843260
ty_tup(_) => ~"tuple",
32853261
ty_infer(TyVar(_)) => ~"inferred type",
32863262
ty_infer(IntVar(_)) => ~"integral variable",
3287-
ty_infer(FloatVar(_)) => ~"floating-point variable",
32883263
ty_param(_) => ~"type parameter",
32893264
ty_self => ~"self"
32903265
}
@@ -3412,10 +3387,6 @@ fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str {
34123387
~"couldn't determine an appropriate integral type for integer \
34133388
literal"
34143389
}
3415-
terr_no_floating_point_type => {
3416-
~"couldn't determine an appropriate floating point type for \
3417-
floating point literal"
3418-
}
34193390
}
34203391
}
34213392

@@ -4029,7 +4000,7 @@ fn is_binopable(_cx: ctxt, ty: t, op: ast::binop) -> bool {
40294000
match get(ty).sty {
40304001
ty_bool => tycat_bool,
40314002
ty_int(_) | ty_uint(_) | ty_infer(IntVar(_)) => tycat_int,
4032-
ty_float(_) | ty_infer(FloatVar(_)) => tycat_float,
4003+
ty_float(_) => tycat_float,
40334004
ty_rec(_) | ty_tup(_) | ty_enum(_, _) => tycat_struct,
40344005
ty_bot => tycat_bot,
40354006
_ => tycat_other
@@ -4259,11 +4230,6 @@ impl IntVid : cmp::Eq {
42594230
pure fn ne(other: &IntVid) -> bool { *self != *(*other) }
42604231
}
42614232

4262-
impl FloatVid : cmp::Eq {
4263-
pure fn eq(other: &FloatVid) -> bool { *self == *(*other) }
4264-
pure fn ne(other: &FloatVid) -> bool { *self != *(*other) }
4265-
}
4266-
42674233
impl FnVid : cmp::Eq {
42684234
pure fn eq(other: &FnVid) -> bool { *self == *(*other) }
42694235
pure fn ne(other: &FnVid) -> bool { *self != *(*other) }

branches/incoming/src/librustc/middle/typeck/check.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -850,11 +850,6 @@ fn check_lit(fcx: @fn_ctxt, lit: @ast::lit) -> ty::t {
850850
ty::mk_int_var(tcx, fcx.infcx().next_int_var_id())
851851
}
852852
ast::lit_float(_, t) => ty::mk_mach_float(tcx, t),
853-
ast::lit_float_unsuffixed(_) => {
854-
// An unsuffixed floating point literal could have any floating point
855-
// type, so we create a floating point type variable for it.
856-
ty::mk_float_var(tcx, fcx.infcx().next_float_var_id())
857-
}
858853
ast::lit_nil => ty::mk_nil(tcx),
859854
ast::lit_bool(_) => ty::mk_bool(tcx)
860855
}

branches/incoming/src/librustc/middle/typeck/check/method.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,6 @@ impl LookupContext {
664664
match ty::get(self_ty).sty {
665665
ty_box(*) | ty_uniq(*) | ty_rptr(*) |
666666
ty_infer(IntVar(_)) | // FIXME(#3211)---should be resolved
667-
ty_infer(FloatVar(_)) | // FIXME(#3211)---should be resolved
668667
ty_self | ty_param(*) | ty_nil | ty_bot | ty_bool |
669668
ty_int(*) | ty_uint(*) |
670669
ty_float(*) | ty_enum(*) | ty_ptr(*) | ty_rec(*) |

branches/incoming/src/librustc/middle/typeck/infer.rs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ overconstrains the type, it's a type error; if we reach the point at
209209
which type variables must be resolved and an integral type variable is
210210
still underconstrained, it defaults to `int` as a last resort.
211211
212-
Floating point types are handled similarly to integral types.
213-
214212
## GLB/LUB
215213
216214
Computing the greatest-lower-bound and least-upper-bound of two
@@ -252,8 +250,8 @@ use std::smallintmap;
252250
use std::smallintmap::smallintmap;
253251
use std::map::HashMap;
254252
use middle::ty;
255-
use middle::ty::{TyVid, IntVid, FloatVid, RegionVid, vid,
256-
ty_int, ty_uint, get, terr_fn, TyVar, IntVar, FloatVar};
253+
use middle::ty::{TyVid, IntVid, RegionVid, vid,
254+
ty_int, ty_uint, get, terr_fn, TyVar, IntVar};
257255
use syntax::{ast, ast_util};
258256
use syntax::ast::{ret_style, purity};
259257
use util::ppaux::{ty_to_str, mt_to_str};
@@ -274,7 +272,6 @@ use resolve::{resolve_nested_tvar, resolve_rvar, resolve_ivar, resolve_all,
274272
resolve_and_force_all_but_regions, resolver};
275273
use unify::{vals_and_bindings, root};
276274
use integral::{int_ty_set, int_ty_set_all};
277-
use floating::{float_ty_set, float_ty_set_all};
278275
use combine::{combine_fields, eq_tys};
279276
use assignment::Assign;
280277
use to_str::ToStr;
@@ -321,17 +318,12 @@ enum infer_ctxt = @{
321318
// represented by an int_ty_set.
322319
int_var_bindings: vals_and_bindings<ty::IntVid, int_ty_set>,
323320

324-
// The types that might instantiate a floating-point type variable are
325-
// represented by an float_ty_set.
326-
float_var_bindings: vals_and_bindings<ty::FloatVid, float_ty_set>,
327-
328321
// For region variables.
329322
region_vars: RegionVarBindings,
330323

331324
// For keeping track of existing type and region variables.
332325
ty_var_counter: @mut uint,
333326
int_var_counter: @mut uint,
334-
float_var_counter: @mut uint,
335327
region_var_counter: @mut uint
336328
};
337329

@@ -367,11 +359,9 @@ fn new_infer_ctxt(tcx: ty::ctxt) -> infer_ctxt {
367359
infer_ctxt(@{tcx: tcx,
368360
ty_var_bindings: new_vals_and_bindings(),
369361
int_var_bindings: new_vals_and_bindings(),
370-
float_var_bindings: new_vals_and_bindings(),
371362
region_vars: RegionVarBindings(tcx),
372363
ty_var_counter: @mut 0u,
373364
int_var_counter: @mut 0u,
374-
float_var_counter: @mut 0u,
375365
region_var_counter: @mut 0u})}
376366

377367
fn mk_subty(cx: infer_ctxt, a_is_expected: bool, span: span,
@@ -637,18 +627,6 @@ impl infer_ctxt {
637627
ty::mk_int_var(self.tcx, self.next_int_var_id())
638628
}
639629

640-
fn next_float_var_id() -> FloatVid {
641-
let id = *self.float_var_counter;
642-
*self.float_var_counter += 1;
643-
644-
self.float_var_bindings.vals.insert(id, root(float_ty_set_all(), 0));
645-
return FloatVid(id);
646-
}
647-
648-
fn next_float_var() -> ty::t {
649-
ty::mk_float_var(self.tcx, self.next_float_var_id())
650-
}
651-
652630
fn next_region_var_nb(span: span) -> ty::Region {
653631
ty::re_infer(ty::ReVar(self.region_vars.new_region_var(span)))
654632
}

branches/incoming/src/librustc/middle/typeck/infer/combine.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -385,17 +385,6 @@ fn super_tys<C:combine>(
385385
self.infcx().t_sub_int_var(a, b_id).then(|| Ok(a) )
386386
}
387387

388-
// Relate floating-point variables to other types
389-
(ty::ty_infer(FloatVar(a_id)), ty::ty_infer(FloatVar(b_id))) => {
390-
self.infcx().float_vars(a_id, b_id).then(|| Ok(a) )
391-
}
392-
(ty::ty_infer(FloatVar(a_id)), ty::ty_float(_)) => {
393-
self.infcx().float_var_sub_t(a_id, b).then(|| Ok(a) )
394-
}
395-
(ty::ty_float(_), ty::ty_infer(FloatVar(b_id))) => {
396-
self.infcx().t_sub_float_var(a, b_id).then(|| Ok(a) )
397-
}
398-
399388
(ty::ty_int(_), _) |
400389
(ty::ty_uint(_), _) |
401390
(ty::ty_float(_), _) => {

0 commit comments

Comments
 (0)