Cleanup FIXMEs
This commit is contained in:
parent
d4d5be18b7
commit
4e2b946e65
3 changed files with 0 additions and 28 deletions
|
@ -31,7 +31,6 @@ pub enum ConstInt {
|
||||||
U64(u64),
|
U64(u64),
|
||||||
U128(u128),
|
U128(u128),
|
||||||
Usize(ConstUsize),
|
Usize(ConstUsize),
|
||||||
// FIXME: i128
|
|
||||||
Infer(u128),
|
Infer(u128),
|
||||||
InferSigned(i128),
|
InferSigned(i128),
|
||||||
}
|
}
|
||||||
|
@ -56,7 +55,6 @@ macro_rules! bounds {
|
||||||
mod ubounds {
|
mod ubounds {
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
use rustc_i128::{u128, i128};
|
use rustc_i128::{u128, i128};
|
||||||
// FIXME: min are problably all wrong for signed here.
|
|
||||||
bounds!{u128: 0,
|
bounds!{u128: 0,
|
||||||
i8 I8MIN I8MAX i16 I16MIN I16MAX i32 I32MIN I32MAX i64 I64MIN I64MAX i128 I128MIN I128MAX
|
i8 I8MIN I8MAX i16 I16MIN I16MAX i32 I32MIN I32MAX i64 I64MIN I64MAX i128 I128MIN I128MAX
|
||||||
u8 U8MIN U8MAX u16 U16MIN U16MAX u32 U32MIN U32MAX u64 U64MIN U64MAX u128 U128MIN U128MAX
|
u8 U8MIN U8MAX u16 U16MIN U16MAX u32 U32MIN U32MAX u64 U64MIN U64MAX u128 U128MIN U128MAX
|
||||||
|
@ -155,7 +153,6 @@ impl ConstInt {
|
||||||
I16(i) if i < 0 => InferSigned(i as i128),
|
I16(i) if i < 0 => InferSigned(i as i128),
|
||||||
I32(i) if i < 0 => InferSigned(i as i128),
|
I32(i) if i < 0 => InferSigned(i as i128),
|
||||||
I64(i) if i < 0 => InferSigned(i as i128),
|
I64(i) if i < 0 => InferSigned(i as i128),
|
||||||
// FIXME: 1128, compare with i128
|
|
||||||
I128(i) if i < 0 => InferSigned(i as i128),
|
I128(i) if i < 0 => InferSigned(i as i128),
|
||||||
Isize(Is16(i)) if i < 0 => InferSigned(i as i128),
|
Isize(Is16(i)) if i < 0 => InferSigned(i as i128),
|
||||||
Isize(Is32(i)) if i < 0 => InferSigned(i as i128),
|
Isize(Is32(i)) if i < 0 => InferSigned(i as i128),
|
||||||
|
@ -165,7 +162,6 @@ impl ConstInt {
|
||||||
I16(i) => Infer(i as u128),
|
I16(i) => Infer(i as u128),
|
||||||
I32(i) => Infer(i as u128),
|
I32(i) => Infer(i as u128),
|
||||||
I64(i) => Infer(i as u128),
|
I64(i) => Infer(i as u128),
|
||||||
// FIXME: i128
|
|
||||||
I128(i) => Infer(i as u128),
|
I128(i) => Infer(i as u128),
|
||||||
Isize(Is16(i)) => Infer(i as u128),
|
Isize(Is16(i)) => Infer(i as u128),
|
||||||
Isize(Is32(i)) => Infer(i as u128),
|
Isize(Is32(i)) => Infer(i as u128),
|
||||||
|
@ -174,7 +170,6 @@ impl ConstInt {
|
||||||
U16(i) => Infer(i as u128),
|
U16(i) => Infer(i as u128),
|
||||||
U32(i) => Infer(i as u128),
|
U32(i) => Infer(i as u128),
|
||||||
U64(i) => Infer(i as u128),
|
U64(i) => Infer(i as u128),
|
||||||
// FIXME: i128
|
|
||||||
U128(i) => Infer(i as u128),
|
U128(i) => Infer(i as u128),
|
||||||
Usize(Us16(i)) => Infer(i as u128),
|
Usize(Us16(i)) => Infer(i as u128),
|
||||||
Usize(Us32(i)) => Infer(i as u128),
|
Usize(Us32(i)) => Infer(i as u128),
|
||||||
|
|
|
@ -375,7 +375,6 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
|
||||||
ast::IntTy::I16 => ConstInt::I16(i16::min_value()),
|
ast::IntTy::I16 => ConstInt::I16(i16::min_value()),
|
||||||
ast::IntTy::I32 => ConstInt::I32(i32::min_value()),
|
ast::IntTy::I32 => ConstInt::I32(i32::min_value()),
|
||||||
ast::IntTy::I64 => ConstInt::I64(i64::min_value()),
|
ast::IntTy::I64 => ConstInt::I64(i64::min_value()),
|
||||||
// FIXME: i128
|
|
||||||
ast::IntTy::I128 => ConstInt::I128(i128::min_value()),
|
ast::IntTy::I128 => ConstInt::I128(i128::min_value()),
|
||||||
ast::IntTy::Is => {
|
ast::IntTy::Is => {
|
||||||
let int_ty = self.hir.tcx().sess.target.int_type;
|
let int_ty = self.hir.tcx().sess.target.int_type;
|
||||||
|
|
|
@ -1207,17 +1207,6 @@ impl IntTy {
|
||||||
format!("{}{}", val as u128, self.ty_to_string())
|
format!("{}{}", val as u128, self.ty_to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ty_max(&self) -> u64 {
|
|
||||||
match *self {
|
|
||||||
IntTy::I8 => 0x80,
|
|
||||||
IntTy::I16 => 0x8000,
|
|
||||||
IntTy::Is | IntTy::I32 => 0x80000000, // FIXME: actually ni about Is
|
|
||||||
IntTy::I64 => 0x8000000000000000,
|
|
||||||
// FIXME: i128
|
|
||||||
IntTy::I128 => !0u64,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn bit_width(&self) -> Option<usize> {
|
pub fn bit_width(&self) -> Option<usize> {
|
||||||
Some(match *self {
|
Some(match *self {
|
||||||
IntTy::Is => return None,
|
IntTy::Is => return None,
|
||||||
|
@ -1256,17 +1245,6 @@ impl UintTy {
|
||||||
format!("{}{}", val, self.ty_to_string())
|
format!("{}{}", val, self.ty_to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ty_max(&self) -> u64 {
|
|
||||||
match *self {
|
|
||||||
UintTy::U8 => 0xff,
|
|
||||||
UintTy::U16 => 0xffff,
|
|
||||||
UintTy::Us | UintTy::U32 => 0xffffffff, // FIXME: actually ni about Us
|
|
||||||
UintTy::U64 => 0xffffffffffffffff,
|
|
||||||
// FIXME: i128
|
|
||||||
UintTy::U128 => 0xffffffffffffffff,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn bit_width(&self) -> Option<usize> {
|
pub fn bit_width(&self) -> Option<usize> {
|
||||||
Some(match *self {
|
Some(match *self {
|
||||||
UintTy::Us => return None,
|
UintTy::Us => return None,
|
||||||
|
|
Loading…
Add table
Reference in a new issue