diff options
| author | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-05-23 19:39:49 +0200 |
|---|---|---|
| committer | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-05-24 20:49:37 +0200 |
| commit | c420531304c1f02561bae5498d80447097ad5e75 (patch) | |
| tree | 67f96f5afa39db64b82f90b62702e60151822a72 /src/libsyntax | |
| parent | cc60a22b1034140505866bbf757095a23b631327 (diff) | |
| download | rust-c420531304c1f02561bae5498d80447097ad5e75.tar.gz rust-c420531304c1f02561bae5498d80447097ad5e75.zip | |
Replace `ScalarKind` with `Primitive`
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 6ae1729295f..c9843de547f 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -33,6 +33,8 @@ use std::fmt; use rustc_data_structures::sync::Lrc; use std::u32; +pub use rustc_target::abi::FloatTy; + #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub struct Label { pub ident: Ident, @@ -1519,41 +1521,6 @@ impl fmt::Display for UintTy { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy, - PartialOrd, Ord)] -pub enum FloatTy { - F32, - F64, -} - -impl fmt::Debug for FloatTy { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::Display::fmt(self, f) - } -} - -impl fmt::Display for FloatTy { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.ty_to_string()) - } -} - -impl FloatTy { - pub fn ty_to_string(&self) -> &'static str { - match *self { - FloatTy::F32 => "f32", - FloatTy::F64 => "f64", - } - } - - pub fn bit_width(&self) -> usize { - match *self { - FloatTy::F32 => 32, - FloatTy::F64 => 64, - } - } -} - // Bind a type to an associated type: `A=Foo`. #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct TypeBinding { |
