]> git.lizzy.rs Git - rust.git/commitdiff
Remove the quad_precision_float feature gate
authorAlex Crichton <alex@alexcrichton.com>
Tue, 24 Jun 2014 23:34:46 +0000 (16:34 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 24 Jun 2014 23:36:12 +0000 (16:36 -0700)
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.

21 files changed:
src/libcore/intrinsics.rs
src/libdebug/lib.rs
src/libdebug/reflect.rs
src/libdebug/repr.rs
src/libhexfloat/lib.rs
src/librustc/front/feature_gate.rs
src/librustc/metadata/tydecode.rs
src/librustc/metadata/tyencode.rs
src/librustc/middle/resolve.rs
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/trans/reflect.rs
src/librustc/middle/trans/type_.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/astconv.rs
src/librustdoc/clean/mod.rs
src/libsyntax/ast.rs
src/libsyntax/ast_util.rs
src/libsyntax/ext/quote.rs
src/libsyntax/parse/lexer/mod.rs
src/test/run-pass/quad-precision-float.rs [deleted file]
src/test/run-pass/reflect-visit-type.rs

index dc43f96b55987e97346d78749fc0de671bc378f8..6519d3b749de403913d65cc77519374a73adac4b 100644 (file)
@@ -96,7 +96,6 @@ pub trait TyVisitor {
 
     fn visit_f32(&mut self) -> bool;
     fn visit_f64(&mut self) -> bool;
-    fn visit_f128(&mut self) -> bool;
 
     fn visit_char(&mut self) -> bool;
 
index 5056c40a2de55ee86ba6d3269e5cd188bbdaa328..b5afb3381ada92c3219c55c704c2f828ea4e9776 100644 (file)
@@ -25,7 +25,7 @@
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/")]
 #![experimental]
-#![feature(managed_boxes, macro_rules, quad_precision_float)]
+#![feature(managed_boxes, macro_rules)]
 #![allow(experimental)]
 
 pub mod fmt;
index f281161113f001ae157766624d803c33666fa617..280e8753b34b5f845d12f2d6bb737b0f82158173 100644 (file)
@@ -179,13 +179,6 @@ fn visit_f64(&mut self) -> bool {
         true
     }
 
-    fn visit_f128(&mut self) -> bool {
-        self.align_to::<f128>();
-        if ! self.inner.visit_f128() { return false; }
-        self.bump_past::<f128>();
-        true
-    }
-
     fn visit_char(&mut self) -> bool {
         self.align_to::<char>();
         if ! self.inner.visit_char() { return false; }
index 4744d92436f2b75829dde916f5e8b7a52c6ce20d..6562e2fb6e3829d68f94c03bfb561439c4496db3 100644 (file)
@@ -258,7 +258,6 @@ fn visit_u64(&mut self) -> bool { self.write::<u64>() }
 
     fn visit_f32(&mut self) -> bool { self.write::<f32>() }
     fn visit_f64(&mut self) -> bool { self.write::<f64>() }
-    fn visit_f128(&mut self) -> bool { fail!("not implemented") }
 
     fn visit_char(&mut self) -> bool {
         self.get::<char>(|this, &ch| {
index f0f05baa28293e84f1555b6ea6b7292d735a68cb..351afc1c5d4e9145caa8ac9223327a352490383d 100644 (file)
@@ -112,7 +112,6 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
         Some(Ident{ident, span}) => match token::get_ident(ident).get() {
             "f32" => Some(ast::TyF32),
             "f64" => Some(ast::TyF64),
-            "f128" => Some(ast::TyF128),
             _ => {
                 cx.span_err(span, "invalid floating point type in hexfloat!");
                 None
index 59e52b9359f50c4fce71e08b0c3419dafb489d79..10d039e4903ecbda5b37b62928eba5ae8c21bed4 100644 (file)
@@ -64,7 +64,7 @@
     ("overloaded_calls", Active),
     ("unboxed_closure_sugar", Active),
 
-    ("quad_precision_float", Active),
+    ("quad_precision_float", Removed),
 
     // A temporary feature gate used to enable parser extensions needed
     // to bootstrap fix for #5723.
@@ -91,7 +91,6 @@ enum Status {
 /// A set of features to be used by later passes.
 pub struct Features {
     pub default_type_params: Cell<bool>,
-    pub quad_precision_float: Cell<bool>,
     pub issue_5723_bootstrap: Cell<bool>,
     pub overloaded_calls: Cell<bool>,
 }
@@ -100,7 +99,6 @@ impl Features {
     pub fn new() -> Features {
         Features {
             default_type_params: Cell::new(false),
-            quad_precision_float: Cell::new(false),
             issue_5723_bootstrap: Cell::new(false),
             overloaded_calls: Cell::new(false),
         }
@@ -425,7 +423,6 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
     sess.abort_if_errors();
 
     sess.features.default_type_params.set(cx.has_feature("default_type_params"));
-    sess.features.quad_precision_float.set(cx.has_feature("quad_precision_float"));
     sess.features.issue_5723_bootstrap.set(cx.has_feature("issue_5723_bootstrap"));
     sess.features.overloaded_calls.set(cx.has_feature("overloaded_calls"));
 }
index 4897117431bbdbc96ae13d9151e81013ac3c2632..4156329331471ffa035f83984c5f1804ca416ce6 100644 (file)
@@ -330,7 +330,6 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
           'D' => return ty::mk_mach_int(ast::TyI64),
           'f' => return ty::mk_mach_float(ast::TyF32),
           'F' => return ty::mk_mach_float(ast::TyF64),
-          'Q' => return ty::mk_mach_float(ast::TyF128),
           _ => fail!("parse_ty: bad numeric type")
         }
       }
index e1fa4abefdd06512ac5af26b14320320998dc238..1f36c3850cf4b19ddd419b3694c7ee73eba3afe6 100644 (file)
@@ -221,7 +221,6 @@ fn enc_sty(w: &mut MemWriter, cx: &ctxt, st: &ty::sty) {
             match t {
                 TyF32 => mywrite!(w, "Mf"),
                 TyF64 => mywrite!(w, "MF"),
-                TyF128 => mywrite!(w, "MQ")
             }
         }
         ty::ty_enum(def, ref substs) => {
index ee6c5e1f9bc318ce0a65585e3023737ab917b611..cb4b6ce043514a894aea586da564f9f736a6203f 100644 (file)
@@ -770,7 +770,6 @@ fn new() -> PrimitiveTypeTable {
         table.intern("char",    TyChar);
         table.intern("f32",     TyFloat(TyF32));
         table.intern("f64",     TyFloat(TyF64));
-        table.intern("f128",    TyFloat(TyF128));
         table.intern("int",     TyInt(TyI));
         table.intern("i8",      TyInt(TyI8));
         table.intern("i16",     TyInt(TyI16));
index 783fdfa4aaec911145cb432fbb8c4fae5f278f74..44e8349644be6e0f430f818c6de1f9a0c4b56385 100644 (file)
@@ -1621,7 +1621,6 @@ fn basic_type_metadata(cx: &CrateContext, t: ty::t) -> DIType {
         ty::ty_float(float_ty) => match float_ty {
             ast::TyF32 => ("f32".to_string(), DW_ATE_float),
             ast::TyF64 => ("f64".to_string(), DW_ATE_float),
-            ast::TyF128 => ("f128".to_string(), DW_ATE_float)
         },
         _ => cx.sess().bug("debuginfo::basic_type_metadata - t is invalid type")
     };
index 59903324e10eaaf2c5c6b2061eb59df0ff6e659d..91148d31423fb59a9e0ee6e560ef4a2ce5123aa3 100644 (file)
@@ -148,7 +148,6 @@ pub fn visit_ty(&mut self, t: ty::t) {
           ty::ty_uint(ast::TyU64) => self.leaf("u64"),
           ty::ty_float(ast::TyF32) => self.leaf("f32"),
           ty::ty_float(ast::TyF64) => self.leaf("f64"),
-          ty::ty_float(ast::TyF128) => self.leaf("f128"),
 
           // Should rename to vec_*.
           ty::ty_vec(ref mt, Some(sz)) => {
index 595777a74cba1223dea5f8d42e8f1e400e0b208c..1ec792182bd1e5171379ca28bbd333ec3637ef04 100644 (file)
@@ -88,10 +88,6 @@ pub fn f64(ccx: &CrateContext) -> Type {
         ty!(llvm::LLVMDoubleTypeInContext(ccx.llcx))
     }
 
-    pub fn f128(ccx: &CrateContext) -> Type {
-        ty!(llvm::LLVMFP128TypeInContext(ccx.llcx))
-    }
-
     pub fn bool(ccx: &CrateContext) -> Type {
         Type::i1(ccx)
     }
@@ -135,7 +131,6 @@ pub fn float_from_ty(ccx: &CrateContext, t: ast::FloatTy) -> Type {
         match t {
             ast::TyF32 => Type::f32(ccx),
             ast::TyF64 => Type::f64(ccx),
-            ast::TyF128 => Type::f128(ccx)
         }
     }
 
index 00a0e8fc39bd6d92c68a803ce9a48f512eb02825..b8a9c4a16c5f4fde59131cdd776dbca77d9934df 100644 (file)
@@ -694,7 +694,6 @@ macro_rules! def_prim_ty(
     def_prim_ty!(TY_U64,    super::ty_uint(ast::TyU64),     12)
     def_prim_ty!(TY_F32,    super::ty_float(ast::TyF32),    14)
     def_prim_ty!(TY_F64,    super::ty_float(ast::TyF64),    15)
-    def_prim_ty!(TY_F128,   super::ty_float(ast::TyF128),   16)
 
     pub static TY_BOT: t_box_ = t_box_ {
         sty: super::ty_bot,
@@ -1272,9 +1271,6 @@ pub fn mk_f32() -> t { mk_prim_t(&primitives::TY_F32) }
 #[inline]
 pub fn mk_f64() -> t { mk_prim_t(&primitives::TY_F64) }
 
-#[inline]
-pub fn mk_f128() -> t { mk_prim_t(&primitives::TY_F128) }
-
 #[inline]
 pub fn mk_uint() -> t { mk_prim_t(&primitives::TY_UINT) }
 
@@ -1314,7 +1310,6 @@ pub fn mk_mach_float(tm: ast::FloatTy) -> t {
     match tm {
         ast::TyF32  => mk_f32(),
         ast::TyF64  => mk_f64(),
-        ast::TyF128 => mk_f128()
     }
 }
 
index 4bf32d15e6424fc1a4a0e725259eb5b02ebcb0c4..1ad15e536ecc474f5f8cc71ec10a351729f371bf 100644 (file)
@@ -355,13 +355,6 @@ pub fn ast_ty_to_prim_ty(tcx: &ty::ctxt, ast_ty: &ast::Ty) -> Option<ty::t> {
                             Some(ty::mk_mach_uint(uit))
                         }
                         ast::TyFloat(ft) => {
-                            if ft == ast::TyF128 && !tcx.sess.features.quad_precision_float.get() {
-                                tcx.sess.span_err(path.span, "quadruple precision floats are \
-                                                              missing complete runtime support");
-                                tcx.sess.span_note(path.span, "add \
-                                                               #[feature(quad_precision_float)] \
-                                                               to the crate attributes to enable");
-                            }
                             check_path_args(tcx, path, NO_TPS | NO_REGIONS);
                             Some(ty::mk_mach_float(ft))
                         }
index 66d0b5c2857ed47d57ec01cb268bddbcd8379a67..d7bbb439dbb7788f175130fbf9f8a1db2ae771a3 100644 (file)
@@ -1072,7 +1072,7 @@ pub enum Type {
 pub enum Primitive {
     Int, I8, I16, I32, I64,
     Uint, U8, U16, U32, U64,
-    F32, F64, F128,
+    F32, F64,
     Char,
     Bool,
     Nil,
@@ -1111,7 +1111,6 @@ fn from_str(s: &str) -> Option<Primitive> {
             "str" => Some(Str),
             "f32" => Some(F32),
             "f64" => Some(F64),
-            "f128" => Some(F128),
             "slice" => Some(Slice),
             "tuple" => Some(PrimitiveTuple),
             _ => None,
@@ -1153,7 +1152,6 @@ pub fn to_str(&self) -> &'static str {
             U64 => "u64",
             F32 => "f32",
             F64 => "f64",
-            F128 => "f128",
             Str => "str",
             Bool => "bool",
             Char => "char",
@@ -1227,7 +1225,6 @@ fn clean(&self) -> Type {
             ty::ty_uint(ast::TyU64) => Primitive(U64),
             ty::ty_float(ast::TyF32) => Primitive(F32),
             ty::ty_float(ast::TyF64) => Primitive(F64),
-            ty::ty_float(ast::TyF128) => Primitive(F128),
             ty::ty_str => Primitive(Str),
             ty::ty_box(t) => Managed(box t.clean()),
             ty::ty_uniq(t) => Unique(box t.clean()),
@@ -2010,7 +2007,6 @@ fn resolve_type(path: Path, tpbs: Option<Vec<TyParamBound>>,
             ast::TyUint(ast::TyU64) => return Primitive(U64),
             ast::TyFloat(ast::TyF32) => return Primitive(F32),
             ast::TyFloat(ast::TyF64) => return Primitive(F64),
-            ast::TyFloat(ast::TyF128) => return Primitive(F128),
         },
         def::DefTyParam(_, i, _) => return Generic(i),
         def::DefTyParamBinder(i) => return TyParamBinder(i),
index aeafc0e306c21e0e270c5ea8b0f626b888b80f08..cb753809ffe42b27f13394395abc9db45e9c064d 100644 (file)
@@ -700,7 +700,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 pub enum FloatTy {
     TyF32,
     TyF64,
-    TyF128
 }
 
 impl fmt::Show for FloatTy {
index d28553da69173b3b5ee20ecac72292328d673cac..f6c18929006d80d945d881385d873ea088c715cd 100644 (file)
@@ -179,7 +179,6 @@ pub fn float_ty_to_str(t: FloatTy) -> String {
     match t {
         TyF32 => "f32".to_string(),
         TyF64 => "f64".to_string(),
-        TyF128 => "f128".to_string(),
     }
 }
 
index 407715ab4dae096e681d7a104f6aba9adf98da12..97033ccee15f46ad041040491dcd5ea6022bd9da 100644 (file)
@@ -483,7 +483,6 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> Gc<ast::Expr> {
             let s_fty = match fty {
                 ast::TyF32 => "TyF32",
                 ast::TyF64 => "TyF64",
-                ast::TyF128 => "TyF128"
             };
             let e_fty = mk_ast_path(cx, sp, s_fty);
             let e_fident = mk_ident(cx, sp, fident);
index add9a4cb9f3bd14e6f961b03d9bafd56818208f5..ac570c888375c4bcf8e15e6f73ab18ab8d7858c3 100644 (file)
@@ -639,16 +639,9 @@ enum Result { Signed(ast::IntTy), Unsigned(ast::UintTy) }
                 /* FIXME (#2252): if this is out of range for either a
                 32-bit or 64-bit float, it won't be noticed till the
                 back-end.  */
-            } else if c == '1' && n == '2' && self.nextnextch().unwrap_or('\x00') == '8' {
-                self.bump();
-                self.bump();
-                self.bump();
-                let last_bpos = self.last_pos;
-                self.check_float_base(start_bpos, last_bpos, base);
-                return token::LIT_FLOAT(str_to_ident(num_str.as_slice()), ast::TyF128);
             }
             let last_bpos = self.last_pos;
-            self.err_span_(start_bpos, last_bpos, "expected `f32`, `f64` or `f128` suffix");
+            self.err_span_(start_bpos, last_bpos, "expected `f32` or `f64` suffix");
         }
         if is_float {
             let last_bpos = self.last_pos;
diff --git a/src/test/run-pass/quad-precision-float.rs b/src/test/run-pass/quad-precision-float.rs
deleted file mode 100644 (file)
index d682766..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(quad_precision_float)]
-
-static x: f128 = 1.0 + 2.0;
-
-fn foo(a: f128) -> f128 { a }
-
-pub fn main() {
-    let y = x;
-    foo(y);
-}
index b471d13901e093a4878c370ad2df856ca81ab7b0..9757db9df4cfd1df7b021881cfce629c3f49fec7 100644 (file)
@@ -58,7 +58,6 @@ fn visit_u64(&mut self) -> bool { true }
 
     fn visit_f32(&mut self) -> bool { true }
     fn visit_f64(&mut self) -> bool { true }
-    fn visit_f128(&mut self) -> bool { true }
 
     fn visit_char(&mut self) -> bool { true }