[breaking-change] don't glob export ast::FloatTy variants

This commit is contained in:
Oliver Schneider
2016-02-08 16:09:01 +01:00
parent 80bf9ae18a
commit ccf48bcd40
14 changed files with 37 additions and 38 deletions

View File

@@ -10,7 +10,6 @@
// The Rust abstract syntax tree.
pub use self::FloatTy::*;
pub use self::ForeignItem_::*;
pub use self::IntTy::*;
pub use self::Item_::*;
@@ -1509,8 +1508,8 @@ impl fmt::Display for UintTy {
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
pub enum FloatTy {
TyF32,
TyF64,
F32,
F64,
}
impl fmt::Debug for FloatTy {
@@ -1528,15 +1527,15 @@ impl fmt::Display for FloatTy {
impl FloatTy {
pub fn ty_to_string(&self) -> &'static str {
match *self {
TyF32 => "f32",
TyF64 => "f64",
FloatTy::F32 => "f32",
FloatTy::F64 => "f64",
}
}
pub fn bit_width(&self) -> usize {
match *self {
TyF32 => 32,
TyF64 => 64,
FloatTy::F32 => 32,
FloatTy::F64 => 64,
}
}
}

View File

@@ -452,8 +452,8 @@ fn filtered_float_lit(data: token::InternedString, suffix: Option<&str>,
sd: &Handler, sp: Span) -> ast::Lit_ {
debug!("filtered_float_lit: {}, {:?}", data, suffix);
match suffix.as_ref().map(|s| &**s) {
Some("f32") => ast::LitFloat(data, ast::TyF32),
Some("f64") => ast::LitFloat(data, ast::TyF64),
Some("f32") => ast::LitFloat(data, ast::FloatTy::F32),
Some("f64") => ast::LitFloat(data, ast::FloatTy::F64),
Some(suf) => {
if suf.len() >= 2 && looks_like_width_suffix(&['f'], suf) {
// if it looks like a width, lets try to be helpful.