Skip to content

Commit 3d308fe

Browse files
committed
Remove the quad_precision_float feature gate
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
1 parent 719ffc2 commit 3d308fe

File tree

21 files changed

+4
-74
lines changed

21 files changed

+4
-74
lines changed

src/libcore/intrinsics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ pub trait TyVisitor {
9696

9797
fn visit_f32(&mut self) -> bool;
9898
fn visit_f64(&mut self) -> bool;
99-
fn visit_f128(&mut self) -> bool;
10099

101100
fn visit_char(&mut self) -> bool;
102101

src/libdebug/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2626
html_root_url = "http://doc.rust-lang.org/")]
2727
#![experimental]
28-
#![feature(managed_boxes, macro_rules, quad_precision_float)]
28+
#![feature(managed_boxes, macro_rules)]
2929
#![allow(experimental)]
3030

3131
pub mod fmt;

src/libdebug/reflect.rs

-7
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
179179
true
180180
}
181181

182-
fn visit_f128(&mut self) -> bool {
183-
self.align_to::<f128>();
184-
if ! self.inner.visit_f128() { return false; }
185-
self.bump_past::<f128>();
186-
true
187-
}
188-
189182
fn visit_char(&mut self) -> bool {
190183
self.align_to::<char>();
191184
if ! self.inner.visit_char() { return false; }

src/libdebug/repr.rs

-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
258258

259259
fn visit_f32(&mut self) -> bool { self.write::<f32>() }
260260
fn visit_f64(&mut self) -> bool { self.write::<f64>() }
261-
fn visit_f128(&mut self) -> bool { fail!("not implemented") }
262261

263262
fn visit_char(&mut self) -> bool {
264263
self.get::<char>(|this, &ch| {

src/libhexfloat/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
112112
Some(Ident{ident, span}) => match token::get_ident(ident).get() {
113113
"f32" => Some(ast::TyF32),
114114
"f64" => Some(ast::TyF64),
115-
"f128" => Some(ast::TyF128),
116115
_ => {
117116
cx.span_err(span, "invalid floating point type in hexfloat!");
118117
None

src/librustc/front/feature_gate.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
6464
("overloaded_calls", Active),
6565
("unboxed_closure_sugar", Active),
6666

67-
("quad_precision_float", Active),
67+
("quad_precision_float", Removed),
6868

6969
// A temporary feature gate used to enable parser extensions needed
7070
// to bootstrap fix for #5723.
@@ -91,7 +91,6 @@ enum Status {
9191
/// A set of features to be used by later passes.
9292
pub struct Features {
9393
pub default_type_params: Cell<bool>,
94-
pub quad_precision_float: Cell<bool>,
9594
pub issue_5723_bootstrap: Cell<bool>,
9695
pub overloaded_calls: Cell<bool>,
9796
}
@@ -100,7 +99,6 @@ impl Features {
10099
pub fn new() -> Features {
101100
Features {
102101
default_type_params: Cell::new(false),
103-
quad_precision_float: Cell::new(false),
104102
issue_5723_bootstrap: Cell::new(false),
105103
overloaded_calls: Cell::new(false),
106104
}
@@ -425,7 +423,6 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
425423
sess.abort_if_errors();
426424

427425
sess.features.default_type_params.set(cx.has_feature("default_type_params"));
428-
sess.features.quad_precision_float.set(cx.has_feature("quad_precision_float"));
429426
sess.features.issue_5723_bootstrap.set(cx.has_feature("issue_5723_bootstrap"));
430427
sess.features.overloaded_calls.set(cx.has_feature("overloaded_calls"));
431428
}

src/librustc/metadata/tydecode.rs

-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
330330
'D' => return ty::mk_mach_int(ast::TyI64),
331331
'f' => return ty::mk_mach_float(ast::TyF32),
332332
'F' => return ty::mk_mach_float(ast::TyF64),
333-
'Q' => return ty::mk_mach_float(ast::TyF128),
334333
_ => fail!("parse_ty: bad numeric type")
335334
}
336335
}

src/librustc/metadata/tyencode.rs

-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ fn enc_sty(w: &mut MemWriter, cx: &ctxt, st: &ty::sty) {
221221
match t {
222222
TyF32 => mywrite!(w, "Mf"),
223223
TyF64 => mywrite!(w, "MF"),
224-
TyF128 => mywrite!(w, "MQ")
225224
}
226225
}
227226
ty::ty_enum(def, ref substs) => {

src/librustc/middle/resolve.rs

-1
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,6 @@ impl PrimitiveTypeTable {
770770
table.intern("char", TyChar);
771771
table.intern("f32", TyFloat(TyF32));
772772
table.intern("f64", TyFloat(TyF64));
773-
table.intern("f128", TyFloat(TyF128));
774773
table.intern("int", TyInt(TyI));
775774
table.intern("i8", TyInt(TyI8));
776775
table.intern("i16", TyInt(TyI16));

src/librustc/middle/trans/debuginfo.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,6 @@ fn basic_type_metadata(cx: &CrateContext, t: ty::t) -> DIType {
16211621
ty::ty_float(float_ty) => match float_ty {
16221622
ast::TyF32 => ("f32".to_string(), DW_ATE_float),
16231623
ast::TyF64 => ("f64".to_string(), DW_ATE_float),
1624-
ast::TyF128 => ("f128".to_string(), DW_ATE_float)
16251624
},
16261625
_ => cx.sess().bug("debuginfo::basic_type_metadata - t is invalid type")
16271626
};

src/librustc/middle/trans/reflect.rs

-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ impl<'a, 'b> Reflector<'a, 'b> {
148148
ty::ty_uint(ast::TyU64) => self.leaf("u64"),
149149
ty::ty_float(ast::TyF32) => self.leaf("f32"),
150150
ty::ty_float(ast::TyF64) => self.leaf("f64"),
151-
ty::ty_float(ast::TyF128) => self.leaf("f128"),
152151

153152
// Should rename to vec_*.
154153
ty::ty_vec(ref mt, Some(sz)) => {

src/librustc/middle/trans/type_.rs

-5
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ impl Type {
8888
ty!(llvm::LLVMDoubleTypeInContext(ccx.llcx))
8989
}
9090

91-
pub fn f128(ccx: &CrateContext) -> Type {
92-
ty!(llvm::LLVMFP128TypeInContext(ccx.llcx))
93-
}
94-
9591
pub fn bool(ccx: &CrateContext) -> Type {
9692
Type::i1(ccx)
9793
}
@@ -135,7 +131,6 @@ impl Type {
135131
match t {
136132
ast::TyF32 => Type::f32(ccx),
137133
ast::TyF64 => Type::f64(ccx),
138-
ast::TyF128 => Type::f128(ccx)
139134
}
140135
}
141136

src/librustc/middle/ty.rs

-5
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,6 @@ mod primitives {
694694
def_prim_ty!(TY_U64, super::ty_uint(ast::TyU64), 12)
695695
def_prim_ty!(TY_F32, super::ty_float(ast::TyF32), 14)
696696
def_prim_ty!(TY_F64, super::ty_float(ast::TyF64), 15)
697-
def_prim_ty!(TY_F128, super::ty_float(ast::TyF128), 16)
698697

699698
pub static TY_BOT: t_box_ = t_box_ {
700699
sty: super::ty_bot,
@@ -1272,9 +1271,6 @@ pub fn mk_f32() -> t { mk_prim_t(&primitives::TY_F32) }
12721271
#[inline]
12731272
pub fn mk_f64() -> t { mk_prim_t(&primitives::TY_F64) }
12741273

1275-
#[inline]
1276-
pub fn mk_f128() -> t { mk_prim_t(&primitives::TY_F128) }
1277-
12781274
#[inline]
12791275
pub fn mk_uint() -> t { mk_prim_t(&primitives::TY_UINT) }
12801276

@@ -1314,7 +1310,6 @@ pub fn mk_mach_float(tm: ast::FloatTy) -> t {
13141310
match tm {
13151311
ast::TyF32 => mk_f32(),
13161312
ast::TyF64 => mk_f64(),
1317-
ast::TyF128 => mk_f128()
13181313
}
13191314
}
13201315

src/librustc/middle/typeck/astconv.rs

-7
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,6 @@ pub fn ast_ty_to_prim_ty(tcx: &ty::ctxt, ast_ty: &ast::Ty) -> Option<ty::t> {
355355
Some(ty::mk_mach_uint(uit))
356356
}
357357
ast::TyFloat(ft) => {
358-
if ft == ast::TyF128 && !tcx.sess.features.quad_precision_float.get() {
359-
tcx.sess.span_err(path.span, "quadruple precision floats are \
360-
missing complete runtime support");
361-
tcx.sess.span_note(path.span, "add \
362-
#[feature(quad_precision_float)] \
363-
to the crate attributes to enable");
364-
}
365358
check_path_args(tcx, path, NO_TPS | NO_REGIONS);
366359
Some(ty::mk_mach_float(ft))
367360
}

src/librustdoc/clean/mod.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ pub enum Type {
10721072
pub enum Primitive {
10731073
Int, I8, I16, I32, I64,
10741074
Uint, U8, U16, U32, U64,
1075-
F32, F64, F128,
1075+
F32, F64,
10761076
Char,
10771077
Bool,
10781078
Nil,
@@ -1111,7 +1111,6 @@ impl Primitive {
11111111
"str" => Some(Str),
11121112
"f32" => Some(F32),
11131113
"f64" => Some(F64),
1114-
"f128" => Some(F128),
11151114
"slice" => Some(Slice),
11161115
"tuple" => Some(PrimitiveTuple),
11171116
_ => None,
@@ -1153,7 +1152,6 @@ impl Primitive {
11531152
U64 => "u64",
11541153
F32 => "f32",
11551154
F64 => "f64",
1156-
F128 => "f128",
11571155
Str => "str",
11581156
Bool => "bool",
11591157
Char => "char",
@@ -1227,7 +1225,6 @@ impl Clean<Type> for ty::t {
12271225
ty::ty_uint(ast::TyU64) => Primitive(U64),
12281226
ty::ty_float(ast::TyF32) => Primitive(F32),
12291227
ty::ty_float(ast::TyF64) => Primitive(F64),
1230-
ty::ty_float(ast::TyF128) => Primitive(F128),
12311228
ty::ty_str => Primitive(Str),
12321229
ty::ty_box(t) => Managed(box t.clean()),
12331230
ty::ty_uniq(t) => Unique(box t.clean()),
@@ -2010,7 +2007,6 @@ fn resolve_type(path: Path, tpbs: Option<Vec<TyParamBound>>,
20102007
ast::TyUint(ast::TyU64) => return Primitive(U64),
20112008
ast::TyFloat(ast::TyF32) => return Primitive(F32),
20122009
ast::TyFloat(ast::TyF64) => return Primitive(F64),
2013-
ast::TyFloat(ast::TyF128) => return Primitive(F128),
20142010
},
20152011
def::DefTyParam(_, i, _) => return Generic(i),
20162012
def::DefTyParamBinder(i) => return TyParamBinder(i),

src/libsyntax/ast.rs

-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ impl fmt::Show for UintTy {
700700
pub enum FloatTy {
701701
TyF32,
702702
TyF64,
703-
TyF128
704703
}
705704

706705
impl fmt::Show for FloatTy {

src/libsyntax/ast_util.rs

-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ pub fn float_ty_to_str(t: FloatTy) -> String {
179179
match t {
180180
TyF32 => "f32".to_string(),
181181
TyF64 => "f64".to_string(),
182-
TyF128 => "f128".to_string(),
183182
}
184183
}
185184

src/libsyntax/ext/quote.rs

-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> Gc<ast::Expr> {
483483
let s_fty = match fty {
484484
ast::TyF32 => "TyF32",
485485
ast::TyF64 => "TyF64",
486-
ast::TyF128 => "TyF128"
487486
};
488487
let e_fty = mk_ast_path(cx, sp, s_fty);
489488
let e_fident = mk_ident(cx, sp, fident);

src/libsyntax/parse/lexer/mod.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -639,16 +639,9 @@ impl<'a> StringReader<'a> {
639639
/* FIXME (#2252): if this is out of range for either a
640640
32-bit or 64-bit float, it won't be noticed till the
641641
back-end. */
642-
} else if c == '1' && n == '2' && self.nextnextch().unwrap_or('\x00') == '8' {
643-
self.bump();
644-
self.bump();
645-
self.bump();
646-
let last_bpos = self.last_pos;
647-
self.check_float_base(start_bpos, last_bpos, base);
648-
return token::LIT_FLOAT(str_to_ident(num_str.as_slice()), ast::TyF128);
649642
}
650643
let last_bpos = self.last_pos;
651-
self.err_span_(start_bpos, last_bpos, "expected `f32`, `f64` or `f128` suffix");
644+
self.err_span_(start_bpos, last_bpos, "expected `f32` or `f64` suffix");
652645
}
653646
if is_float {
654647
let last_bpos = self.last_pos;

src/test/run-pass/quad-precision-float.rs

-20
This file was deleted.

src/test/run-pass/reflect-visit-type.rs

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ impl TyVisitor for MyVisitor {
5858

5959
fn visit_f32(&mut self) -> bool { true }
6060
fn visit_f64(&mut self) -> bool { true }
61-
fn visit_f128(&mut self) -> bool { true }
6261

6362
fn visit_char(&mut self) -> bool { true }
6463

0 commit comments

Comments
 (0)