rollup merge of #20609: cmr/mem

This commit is contained in:
Alex Crichton 2015-01-06 15:07:48 -08:00
commit 5f27b50080
106 changed files with 721 additions and 716 deletions

View File

@ -46,7 +46,7 @@ use syntax::ast_util::is_shift_binop;
use syntax::attr::{self, AttrMetaMethods};
use syntax::codemap::{Span, DUMMY_SP};
use syntax::parse::token;
use syntax::ast::{TyI, TyU, TyI8, TyU8, TyI16, TyU16, TyI32, TyU32, TyI64, TyU64};
use syntax::ast::{TyIs, TyUs, TyI8, TyU8, TyI16, TyU16, TyI32, TyU32, TyI64, TyU64};
use syntax::ast_util;
use syntax::ptr::P;
use syntax::visit::{self, Visitor};
@ -216,7 +216,7 @@ impl LintPass for TypeLimits {
match lit.node {
ast::LitInt(v, ast::SignedIntLit(_, ast::Plus)) |
ast::LitInt(v, ast::UnsuffixedIntLit(ast::Plus)) => {
let int_type = if t == ast::TyI {
let int_type = if t == ast::TyIs {
cx.sess().target.int_type
} else { t };
let (min, max) = int_ty_range(int_type);
@ -233,7 +233,7 @@ impl LintPass for TypeLimits {
};
},
ty::ty_uint(t) => {
let uint_type = if t == ast::TyU {
let uint_type = if t == ast::TyUs {
cx.sess().target.uint_type
} else { t };
let (min, max) = uint_ty_range(uint_type);
@ -296,7 +296,7 @@ impl LintPass for TypeLimits {
// warnings are consistent between 32- and 64-bit platforms
fn int_ty_range(int_ty: ast::IntTy) -> (i64, i64) {
match int_ty {
ast::TyI => (i64::MIN, i64::MAX),
ast::TyIs=> (i64::MIN, i64::MAX),
ast::TyI8 => (i8::MIN as i64, i8::MAX as i64),
ast::TyI16 => (i16::MIN as i64, i16::MAX as i64),
ast::TyI32 => (i32::MIN as i64, i32::MAX as i64),
@ -306,7 +306,7 @@ impl LintPass for TypeLimits {
fn uint_ty_range(uint_ty: ast::UintTy) -> (u64, u64) {
match uint_ty {
ast::TyU => (u64::MIN, u64::MAX),
ast::TyUs=> (u64::MIN, u64::MAX),
ast::TyU8 => (u8::MIN as u64, u8::MAX as u64),
ast::TyU16 => (u16::MIN as u64, u16::MAX as u64),
ast::TyU32 => (u32::MIN as u64, u32::MAX as u64),
@ -323,7 +323,7 @@ impl LintPass for TypeLimits {
fn int_ty_bits(int_ty: ast::IntTy, target_int_ty: ast::IntTy) -> u64 {
match int_ty {
ast::TyI => int_ty_bits(target_int_ty, target_int_ty),
ast::TyIs=> int_ty_bits(target_int_ty, target_int_ty),
ast::TyI8 => i8::BITS as u64,
ast::TyI16 => i16::BITS as u64,
ast::TyI32 => i32::BITS as u64,
@ -333,7 +333,7 @@ impl LintPass for TypeLimits {
fn uint_ty_bits(uint_ty: ast::UintTy, target_uint_ty: ast::UintTy) -> u64 {
match uint_ty {
ast::TyU => uint_ty_bits(target_uint_ty, target_uint_ty),
ast::TyUs=> uint_ty_bits(target_uint_ty, target_uint_ty),
ast::TyU8 => u8::BITS as u64,
ast::TyU16 => u16::BITS as u64,
ast::TyU32 => u32::BITS as u64,
@ -404,14 +404,14 @@ struct ImproperCTypesVisitor<'a, 'tcx: 'a> {
impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
fn check_def(&mut self, sp: Span, ty_id: ast::NodeId, path_id: ast::NodeId) {
match self.cx.tcx.def_map.borrow()[path_id].clone() {
def::DefPrimTy(ast::TyInt(ast::TyI)) => {
def::DefPrimTy(ast::TyInt(ast::TyIs)) => {
self.cx.span_lint(IMPROPER_CTYPES, sp,
"found rust type `int` in foreign module, while \
"found rust type `isize` in foreign module, while \
libc::c_int or libc::c_long should be used");
}
def::DefPrimTy(ast::TyUint(ast::TyU)) => {
def::DefPrimTy(ast::TyUint(ast::TyUs)) => {
self.cx.span_lint(IMPROPER_CTYPES, sp,
"found rust type `uint` in foreign module, while \
"found rust type `usize` in foreign module, while \
libc::c_uint or libc::c_ulong should be used");
}
def::DefTy(..) => {

View File

@ -443,8 +443,8 @@ fn parse_ty_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>, conv: &mut F) -> Ty<'tcx> w
let tcx = st.tcx;
match next(st) {
'b' => return tcx.types.bool,
'i' => return tcx.types.int,
'u' => return tcx.types.uint,
'i' => { /* eat the s of is */ next(st); return tcx.types.int },
'u' => { /* eat the s of us */ next(st); return tcx.types.uint },
'M' => {
match next(st) {
'b' => return tcx.types.u8,

View File

@ -61,7 +61,7 @@ pub fn enc_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>, t: Ty<'t
ty::ty_char => mywrite!(w, "c"),
ty::ty_int(t) => {
match t {
ast::TyI => mywrite!(w, "i"),
ast::TyIs => mywrite!(w, "is"),
ast::TyI8 => mywrite!(w, "MB"),
ast::TyI16 => mywrite!(w, "MW"),
ast::TyI32 => mywrite!(w, "ML"),
@ -70,7 +70,7 @@ pub fn enc_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>, t: Ty<'t
}
ty::ty_uint(t) => {
match t {
ast::TyU => mywrite!(w, "u"),
ast::TyUs => mywrite!(w, "us"),
ast::TyU8 => mywrite!(w, "Mb"),
ast::TyU16 => mywrite!(w, "Mw"),
ast::TyU32 => mywrite!(w, "Ml"),

View File

@ -528,12 +528,12 @@ pub fn eval_const_expr_partial(tcx: &ty::ctxt, e: &Expr) -> Result<const_val, St
eval_const_expr_partial(tcx, &**base)
.and_then(|val| define_casts!(val, {
ty::ty_int(ast::TyI) => (int, const_int, i64),
ty::ty_int(ast::TyIs) => (int, const_int, i64),
ty::ty_int(ast::TyI8) => (i8, const_int, i64),
ty::ty_int(ast::TyI16) => (i16, const_int, i64),
ty::ty_int(ast::TyI32) => (i32, const_int, i64),
ty::ty_int(ast::TyI64) => (i64, const_int, i64),
ty::ty_uint(ast::TyU) => (uint, const_uint, u64),
ty::ty_uint(ast::TyUs) => (uint, const_uint, u64),
ty::ty_uint(ast::TyU8) => (u8, const_uint, u64),
ty::ty_uint(ast::TyU16) => (u16, const_uint, u64),
ty::ty_uint(ast::TyU32) => (u32, const_uint, u64),

View File

@ -2301,12 +2301,12 @@ impl<'tcx> CommonTypes<'tcx> {
bool: intern_ty(arena, interner, ty_bool),
char: intern_ty(arena, interner, ty_char),
err: intern_ty(arena, interner, ty_err),
int: intern_ty(arena, interner, ty_int(ast::TyI)),
int: intern_ty(arena, interner, ty_int(ast::TyIs)),
i8: intern_ty(arena, interner, ty_int(ast::TyI8)),
i16: intern_ty(arena, interner, ty_int(ast::TyI16)),
i32: intern_ty(arena, interner, ty_int(ast::TyI32)),
i64: intern_ty(arena, interner, ty_int(ast::TyI64)),
uint: intern_ty(arena, interner, ty_uint(ast::TyU)),
uint: intern_ty(arena, interner, ty_uint(ast::TyUs)),
u8: intern_ty(arena, interner, ty_uint(ast::TyU8)),
u16: intern_ty(arena, interner, ty_uint(ast::TyU16)),
u32: intern_ty(arena, interner, ty_uint(ast::TyU32)),
@ -2652,7 +2652,7 @@ impl FlagComputation {
pub fn mk_mach_int<'tcx>(tcx: &ctxt<'tcx>, tm: ast::IntTy) -> Ty<'tcx> {
match tm {
ast::TyI => tcx.types.int,
ast::TyIs => tcx.types.int,
ast::TyI8 => tcx.types.i8,
ast::TyI16 => tcx.types.i16,
ast::TyI32 => tcx.types.i32,
@ -2662,7 +2662,7 @@ pub fn mk_mach_int<'tcx>(tcx: &ctxt<'tcx>, tm: ast::IntTy) -> Ty<'tcx> {
pub fn mk_mach_uint<'tcx>(tcx: &ctxt<'tcx>, tm: ast::UintTy) -> Ty<'tcx> {
match tm {
ast::TyU => tcx.types.uint,
ast::TyUs => tcx.types.uint,
ast::TyU8 => tcx.types.u8,
ast::TyU16 => tcx.types.u16,
ast::TyU32 => tcx.types.u32,
@ -3323,7 +3323,7 @@ pub fn type_contents<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> TypeContents {
let result = match ty.sty {
// uint and int are ffi-unsafe
ty_uint(ast::TyU) | ty_int(ast::TyI) => {
ty_uint(ast::TyUs) | ty_int(ast::TyIs) => {
TC::ReachesFfiUnsafe
}
@ -3897,7 +3897,7 @@ pub fn type_is_fresh(ty: Ty) -> bool {
pub fn type_is_uint(ty: Ty) -> bool {
match ty.sty {
ty_infer(IntVar(_)) | ty_uint(ast::TyU) => true,
ty_infer(IntVar(_)) | ty_uint(ast::TyUs) => true,
_ => false
}
}
@ -3943,7 +3943,7 @@ pub fn type_is_signed(ty: Ty) -> bool {
pub fn type_is_machine(ty: Ty) -> bool {
match ty.sty {
ty_int(ast::TyI) | ty_uint(ast::TyU) => false,
ty_int(ast::TyIs) | ty_uint(ast::TyUs) => false,
ty_int(..) | ty_uint(..) | ty_float(..) => true,
_ => false
}

View File

@ -86,9 +86,9 @@ use syntax::ast::{PolyTraitRef, PrimTy, SelfExplicit};
use syntax::ast::{RegionTyParamBound, StructField};
use syntax::ast::{TraitRef, TraitTyParamBound};
use syntax::ast::{Ty, TyBool, TyChar, TyF32};
use syntax::ast::{TyF64, TyFloat, TyI, TyI8, TyI16, TyI32, TyI64, TyInt, TyObjectSum};
use syntax::ast::{TyF64, TyFloat, TyIs, TyI8, TyI16, TyI32, TyI64, TyInt, TyObjectSum};
use syntax::ast::{TyParam, TyParamBound, TyPath, TyPtr, TyPolyTraitRef, TyQPath};
use syntax::ast::{TyRptr, TyStr, TyU, TyU8, TyU16, TyU32, TyU64, TyUint};
use syntax::ast::{TyRptr, TyStr, TyUs, TyU8, TyU16, TyU32, TyU64, TyUint};
use syntax::ast::{TypeImplItem};
use syntax::ast;
use syntax::ast_map;
@ -833,13 +833,15 @@ impl PrimitiveTypeTable {
table.intern("char", TyChar);
table.intern("f32", TyFloat(TyF32));
table.intern("f64", TyFloat(TyF64));
table.intern("int", TyInt(TyI));
table.intern("int", TyInt(TyIs));
table.intern("isize", TyInt(TyIs));
table.intern("i8", TyInt(TyI8));
table.intern("i16", TyInt(TyI16));
table.intern("i32", TyInt(TyI32));
table.intern("i64", TyInt(TyI64));
table.intern("str", TyStr);
table.intern("uint", TyUint(TyU));
table.intern("uint", TyUint(TyUs));
table.intern("usize", TyUint(TyUs));
table.intern("u8", TyUint(TyU8));
table.intern("u16", TyUint(TyU16));
table.intern("u32", TyUint(TyU32));

View File

@ -903,8 +903,8 @@ pub fn fail_if_zero_or_overflows<'blk, 'tcx>(
ty::ty_int(t) => {
let llty = Type::int_from_ty(cx.ccx(), t);
let min = match t {
ast::TyI if llty == Type::i32(cx.ccx()) => i32::MIN as u64,
ast::TyI => i64::MIN as u64,
ast::TyIs if llty == Type::i32(cx.ccx()) => i32::MIN as u64,
ast::TyIs => i64::MIN as u64,
ast::TyI8 => i8::MIN as u64,
ast::TyI16 => i16::MIN as u64,
ast::TyI32 => i32::MIN as u64,

View File

@ -1797,14 +1797,14 @@ fn basic_type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
ty::ty_bool => ("bool".to_string(), DW_ATE_boolean),
ty::ty_char => ("char".to_string(), DW_ATE_unsigned_char),
ty::ty_int(int_ty) => match int_ty {
ast::TyI => ("int".to_string(), DW_ATE_signed),
ast::TyIs => ("isize".to_string(), DW_ATE_signed),
ast::TyI8 => ("i8".to_string(), DW_ATE_signed),
ast::TyI16 => ("i16".to_string(), DW_ATE_signed),
ast::TyI32 => ("i32".to_string(), DW_ATE_signed),
ast::TyI64 => ("i64".to_string(), DW_ATE_signed)
},
ty::ty_uint(uint_ty) => match uint_ty {
ast::TyU => ("uint".to_string(), DW_ATE_unsigned),
ast::TyUs => ("usize".to_string(), DW_ATE_unsigned),
ast::TyU8 => ("u8".to_string(), DW_ATE_unsigned),
ast::TyU16 => ("u16".to_string(), DW_ATE_unsigned),
ast::TyU32 => ("u32".to_string(), DW_ATE_unsigned),
@ -3729,12 +3729,12 @@ fn push_debuginfo_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
ty::ty_bool => output.push_str("bool"),
ty::ty_char => output.push_str("char"),
ty::ty_str => output.push_str("str"),
ty::ty_int(ast::TyI) => output.push_str("int"),
ty::ty_int(ast::TyIs) => output.push_str("isize"),
ty::ty_int(ast::TyI8) => output.push_str("i8"),
ty::ty_int(ast::TyI16) => output.push_str("i16"),
ty::ty_int(ast::TyI32) => output.push_str("i32"),
ty::ty_int(ast::TyI64) => output.push_str("i64"),
ty::ty_uint(ast::TyU) => output.push_str("uint"),
ty::ty_uint(ast::TyUs) => output.push_str("usize"),
ty::ty_uint(ast::TyU8) => output.push_str("u8"),
ty::ty_uint(ast::TyU16) => output.push_str("u16"),
ty::ty_uint(ast::TyU32) => output.push_str("u32"),

View File

@ -112,7 +112,7 @@ impl Type {
pub fn int_from_ty(ccx: &CrateContext, t: ast::IntTy) -> Type {
match t {
ast::TyI => ccx.int_type(),
ast::TyIs => ccx.int_type(),
ast::TyI8 => Type::i8(ccx),
ast::TyI16 => Type::i16(ccx),
ast::TyI32 => Type::i32(ccx),
@ -122,7 +122,7 @@ impl Type {
pub fn uint_from_ty(ccx: &CrateContext, t: ast::UintTy) -> Type {
match t {
ast::TyU => ccx.int_type(),
ast::TyUs => ccx.int_type(),
ast::TyU8 => Type::i8(ccx),
ast::TyU16 => Type::i16(ccx),
ast::TyU32 => Type::i32(ccx),

View File

@ -264,7 +264,7 @@ pub fn type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Type {
}
match unsized_part_of_type(cx.tcx(), t).sty {
ty::ty_str | ty::ty_vec(..) => Type::uint_from_ty(cx, ast::TyU),
ty::ty_str | ty::ty_vec(..) => Type::uint_from_ty(cx, ast::TyUs),
ty::ty_trait(_) => Type::vtable_ptr(cx),
_ => panic!("Unexpected type returned from unsized_part_of_type : {}",
t.repr(cx.tcx()))

View File

@ -4733,7 +4733,7 @@ pub fn check_enum_variants(ccx: &CrateCtxt,
ast::TyU16 => disr as u16 as Disr == disr,
ast::TyU32 => disr as u32 as Disr == disr,
ast::TyU64 => disr as u64 as Disr == disr,
ast::TyU => uint_in_range(ccx, ccx.tcx.sess.target.uint_type, disr)
ast::TyUs => uint_in_range(ccx, ccx.tcx.sess.target.uint_type, disr)
}
}
fn int_in_range(ccx: &CrateCtxt, ty: ast::IntTy, disr: ty::Disr) -> bool {
@ -4742,7 +4742,7 @@ pub fn check_enum_variants(ccx: &CrateCtxt,
ast::TyI16 => disr as i16 as Disr == disr,
ast::TyI32 => disr as i32 as Disr == disr,
ast::TyI64 => disr as i64 as Disr == disr,
ast::TyI => int_in_range(ccx, ccx.tcx.sess.target.int_type, disr)
ast::TyIs => int_in_range(ccx, ccx.tcx.sess.target.int_type, disr)
}
}
match ty {

View File

@ -1238,8 +1238,8 @@ pub enum Type {
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Copy)]
pub enum PrimitiveType {
Int, I8, I16, I32, I64,
Uint, U8, U16, U32, U64,
Isize, I8, I16, I32, I64,
Usize, U8, U16, U32, U64,
F32, F64,
Char,
Bool,
@ -1264,12 +1264,12 @@ pub enum TypeKind {
impl PrimitiveType {
fn from_str(s: &str) -> Option<PrimitiveType> {
match s.as_slice() {
"int" => Some(Int),
"isize" | "int" => Some(Isize),
"i8" => Some(I8),
"i16" => Some(I16),
"i32" => Some(I32),
"i64" => Some(I64),
"uint" => Some(Uint),
"usize" | "uint" => Some(Usize),
"u8" => Some(U8),
"u16" => Some(U16),
"u32" => Some(U32),
@ -1308,12 +1308,12 @@ impl PrimitiveType {
pub fn to_string(&self) -> &'static str {
match *self {
Int => "int",
Isize => "isize",
I8 => "i8",
I16 => "i16",
I32 => "i32",
I64 => "i64",
Uint => "uint",
Usize => "usize",
U8 => "u8",
U16 => "u16",
U32 => "u32",
@ -1387,12 +1387,12 @@ impl<'tcx> Clean<Type> for ty::Ty<'tcx> {
match self.sty {
ty::ty_bool => Primitive(Bool),
ty::ty_char => Primitive(Char),
ty::ty_int(ast::TyI) => Primitive(Int),
ty::ty_int(ast::TyIs) => Primitive(Isize),
ty::ty_int(ast::TyI8) => Primitive(I8),
ty::ty_int(ast::TyI16) => Primitive(I16),
ty::ty_int(ast::TyI32) => Primitive(I32),
ty::ty_int(ast::TyI64) => Primitive(I64),
ty::ty_uint(ast::TyU) => Primitive(Uint),
ty::ty_uint(ast::TyUs) => Primitive(Usize),
ty::ty_uint(ast::TyU8) => Primitive(U8),
ty::ty_uint(ast::TyU16) => Primitive(U16),
ty::ty_uint(ast::TyU32) => Primitive(U32),
@ -2265,12 +2265,12 @@ fn resolve_type(cx: &DocContext,
ast::TyStr => return Primitive(Str),
ast::TyBool => return Primitive(Bool),
ast::TyChar => return Primitive(Char),
ast::TyInt(ast::TyI) => return Primitive(Int),
ast::TyInt(ast::TyIs) => return Primitive(Isize),
ast::TyInt(ast::TyI8) => return Primitive(I8),
ast::TyInt(ast::TyI16) => return Primitive(I16),
ast::TyInt(ast::TyI32) => return Primitive(I32),
ast::TyInt(ast::TyI64) => return Primitive(I64),
ast::TyUint(ast::TyU) => return Primitive(Uint),
ast::TyUint(ast::TyUs) => return Primitive(Usize),
ast::TyUint(ast::TyU8) => return Primitive(U8),
ast::TyUint(ast::TyU16) => return Primitive(U16),
ast::TyUint(ast::TyU32) => return Primitive(U32),

View File

@ -1087,7 +1087,7 @@ pub struct Typedef {
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
pub enum IntTy {
TyI,
TyIs,
TyI8,
TyI16,
TyI32,
@ -1103,7 +1103,7 @@ impl fmt::Show for IntTy {
impl IntTy {
pub fn suffix_len(&self) -> uint {
match *self {
TyI => 1,
TyIs => 1,
TyI8 => 2,
TyI16 | TyI32 | TyI64 => 3,
}
@ -1112,7 +1112,7 @@ impl IntTy {
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
pub enum UintTy {
TyU,
TyUs,
TyU8,
TyU16,
TyU32,
@ -1122,7 +1122,7 @@ pub enum UintTy {
impl UintTy {
pub fn suffix_len(&self) -> uint {
match *self {
TyU => 1,
TyUs => 1,
TyU8 => 2,
TyU16 | TyU32 | TyU64 => 3,
}

View File

@ -120,8 +120,8 @@ pub fn is_path(e: P<Expr>) -> bool {
/// We want to avoid "45int" and "-3int" in favor of "45" and "-3"
pub fn int_ty_to_string(t: IntTy, val: Option<i64>) -> String {
let s = match t {
TyI if val.is_some() => "i",
TyI => "int",
TyIs if val.is_some() => "is",
TyIs => "isize",
TyI8 => "i8",
TyI16 => "i16",
TyI32 => "i32",
@ -141,7 +141,7 @@ pub fn int_ty_max(t: IntTy) -> u64 {
match t {
TyI8 => 0x80u64,
TyI16 => 0x8000u64,
TyI | TyI32 => 0x80000000u64, // actually ni about TyI
TyIs | TyI32 => 0x80000000u64, // actually ni about TyIs
TyI64 => 0x8000000000000000u64
}
}
@ -150,8 +150,8 @@ pub fn int_ty_max(t: IntTy) -> u64 {
/// We want to avoid "42uint" in favor of "42u"
pub fn uint_ty_to_string(t: UintTy, val: Option<u64>) -> String {
let s = match t {
TyU if val.is_some() => "u",
TyU => "uint",
TyUs if val.is_some() => "us",
TyUs => "usize",
TyU8 => "u8",
TyU16 => "u16",
TyU32 => "u32",
@ -168,7 +168,7 @@ pub fn uint_ty_max(t: UintTy) -> u64 {
match t {
TyU8 => 0xffu64,
TyU16 => 0xffffu64,
TyU | TyU32 => 0xffffffffu64, // actually ni about TyU
TyUs | TyU32 => 0xffffffffu64, // actually ni about TyUs
TyU64 => 0xffffffffffffffffu64
}
}

View File

@ -457,8 +457,10 @@ fn int_type_of_word(s: &str) -> Option<IntType> {
"u32" => Some(UnsignedInt(ast::TyU32)),
"i64" => Some(SignedInt(ast::TyI64)),
"u64" => Some(UnsignedInt(ast::TyU64)),
"int" => Some(SignedInt(ast::TyI)),
"uint" => Some(UnsignedInt(ast::TyU)),
"int" => Some(SignedInt(ast::TyIs)),
"uint" => Some(UnsignedInt(ast::TyUs)),
"isize" => Some(SignedInt(ast::TyIs)),
"usize" => Some(UnsignedInt(ast::TyUs)),
_ => None
}
}
@ -502,7 +504,7 @@ impl IntType {
SignedInt(ast::TyI16) | UnsignedInt(ast::TyU16) |
SignedInt(ast::TyI32) | UnsignedInt(ast::TyU32) |
SignedInt(ast::TyI64) | UnsignedInt(ast::TyU64) => true,
SignedInt(ast::TyI) | UnsignedInt(ast::TyU) => false
SignedInt(ast::TyIs) | UnsignedInt(ast::TyUs) => false
}
}
}

View File

@ -642,10 +642,10 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
self.expr(sp, ast::ExprLit(P(respan(sp, lit))))
}
fn expr_uint(&self, span: Span, i: uint) -> P<ast::Expr> {
self.expr_lit(span, ast::LitInt(i as u64, ast::UnsignedIntLit(ast::TyU)))
self.expr_lit(span, ast::LitInt(i as u64, ast::UnsignedIntLit(ast::TyUs)))
}
fn expr_int(&self, sp: Span, i: int) -> P<ast::Expr> {
self.expr_lit(sp, ast::LitInt(i as u64, ast::SignedIntLit(ast::TyI, ast::Sign::new(i))))
self.expr_lit(sp, ast::LitInt(i as u64, ast::SignedIntLit(ast::TyIs, ast::Sign::new(i))))
}
fn expr_u8(&self, sp: Span, u: u8) -> P<ast::Expr> {
self.expr_lit(sp, ast::LitInt(u as u64, ast::UnsignedIntLit(ast::TyU8)))

View File

@ -1031,7 +1031,7 @@ impl<'a> MethodDef<'a> {
let arms: Vec<ast::Arm> = variants.iter().enumerate()
.map(|(index, variant)| {
let pat = variant_to_pat(cx, sp, type_ident, &**variant);
let lit = ast::LitInt(index as u64, ast::UnsignedIntLit(ast::TyU));
let lit = ast::LitInt(index as u64, ast::UnsignedIntLit(ast::TyUs));
cx.arm(sp, vec![pat], cx.expr_lit(sp, lit))
}).collect();

View File

@ -273,13 +273,13 @@ pub mod rt {
);
}
impl_to_source_int! { signed, int, TyI }
impl_to_source_int! { signed, int, TyIs }
impl_to_source_int! { signed, i8, TyI8 }
impl_to_source_int! { signed, i16, TyI16 }
impl_to_source_int! { signed, i32, TyI32 }
impl_to_source_int! { signed, i64, TyI64 }
impl_to_source_int! { unsigned, uint, TyU }
impl_to_source_int! { unsigned, uint, TyUs }
impl_to_source_int! { unsigned, u8, TyU8 }
impl_to_source_int! { unsigned, u16, TyU16 }
impl_to_source_int! { unsigned, u32, TyU32 }

View File

@ -701,12 +701,14 @@ pub fn integer_lit(s: &str, suffix: Option<&str>, sd: &SpanHandler, sp: Span) ->
if let Some(suf) = suffix {
if suf.is_empty() { sd.span_bug(sp, "found empty literal suffix in Some")}
ty = match suf {
"i" => ast::SignedIntLit(ast::TyI, ast::Plus),
"i" => ast::SignedIntLit(ast::TyIs, ast::Plus),
"is" => ast::SignedIntLit(ast::TyIs, ast::Plus),
"i8" => ast::SignedIntLit(ast::TyI8, ast::Plus),
"i16" => ast::SignedIntLit(ast::TyI16, ast::Plus),
"i32" => ast::SignedIntLit(ast::TyI32, ast::Plus),
"i64" => ast::SignedIntLit(ast::TyI64, ast::Plus),
"u" => ast::UnsignedIntLit(ast::TyU),
"u" => ast::UnsignedIntLit(ast::TyUs),
"us" => ast::UnsignedIntLit(ast::TyUs),
"u8" => ast::UnsignedIntLit(ast::TyU8),
"u16" => ast::UnsignedIntLit(ast::TyU16),
"u32" => ast::UnsignedIntLit(ast::TyU32),

View File

@ -9,8 +9,8 @@
// except according to those terms.
fn main() {
let _x: int = [1i, 2, 3]; //~ ERROR expected int, found array of 3 elements
let _x: isize = [1is, 2, 3]; //~ ERROR expected isize, found array of 3 elements
let x: &[int] = &[1, 2, 3];
let _y: &int = x; //~ ERROR expected int, found slice
let x: &[isize] = &[1, 2, 3];
let _y: &isize = x; //~ ERROR expected isize, found slice
}

View File

@ -41,6 +41,6 @@ pub fn baz(x: &Foo<A=Bar>) {
pub fn main() {
let a = 42i;
foo1(a); //~ERROR expected uint, found struct Bar
baz(&a); //~ERROR expected uint, found struct Bar
foo1(a); //~ERROR expected usize, found struct Bar
baz(&a); //~ERROR expected usize, found struct Bar
}

View File

@ -17,8 +17,8 @@ trait Foo<T> {
}
fn f<T:Foo<int>>(t: &T) {
let u: <T as Foo<uint>>::Bar = t.get_bar();
//~^ ERROR the trait `Foo<uint>` is not implemented for the type `T`
let u: <T as Foo<usize>>::Bar = t.get_bar();
//~^ ERROR the trait `Foo<usize>` is not implemented for the type `T`
}
fn main() { }

View File

@ -24,29 +24,29 @@ pub fn f2<T: Foo>(a: T) -> T::A {
}
pub fn f1_int_int() {
f1(2i, 4i);
//~^ ERROR expected uint, found int
f1(2is, 4is);
//~^ ERROR expected usize, found isize
}
pub fn f1_int_uint() {
f1(2i, 4u);
f1(2is, 4us);
}
pub fn f1_uint_uint() {
f1(2u, 4u);
f1(2us, 4us);
//~^ ERROR the trait `Foo` is not implemented
//~| ERROR the trait `Foo` is not implemented
}
pub fn f1_uint_int() {
f1(2u, 4i);
f1(2us, 4is);
//~^ ERROR the trait `Foo` is not implemented
//~| ERROR the trait `Foo` is not implemented
}
pub fn f2_int() {
let _: int = f2(2i);
//~^ ERROR expected `int`, found `uint`
let _: int = f2(2is);
//~^ ERROR expected `isize`, found `usize`
}
pub fn main() { }

View File

@ -9,24 +9,24 @@
// except according to those terms.
struct clam {
x: Box<int>,
y: Box<int>,
x: Box<isize>,
y: Box<isize>,
}
struct fish {
a: Box<int>,
a: Box<isize>,
}
fn main() {
let a: clam = clam{x: box 1, y: box 2};
let b: clam = clam{x: box 10, y: box 20};
let z: int = a.x + b.y; //~ ERROR binary operation `+` cannot be applied to type `Box<int>`
let z: isize = a.x + b.y; //~ ERROR binary operation `+` cannot be applied to type `Box<isize>`
println!("{}", z);
assert_eq!(z, 21);
let forty: fish = fish{a: box 40};
let two: fish = fish{a: box 2};
let answer: int = forty.a + two.a;
//~^ ERROR binary operation `+` cannot be applied to type `Box<int>`
//~^ ERROR binary operation `+` cannot be applied to type `Box<isize>`
println!("{}", answer);
assert_eq!(answer, 42);
}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:expected `collections::string::String`, found `int`
// error-pattern:expected `collections::string::String`, found `isize`
static i: String = 10i;
static i: String = 10is;
fn main() { println!("{}", i); }

View File

@ -8,6 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:`&&` cannot be applied to type `int`
// error-pattern:`&&` cannot be applied to type `isize`
fn main() { let x = 1i && 2i; }
fn main() { let x = 1is && 2is; }

View File

@ -11,5 +11,5 @@
// Tests that we forbid coercion from `[T; n]` to `&[T]`
fn main() {
let _: &[int] = [0i]; //~ERROR: mismatched types: expected `&[int]`, found `[int; 1]`
let _: &[isize] = [0is]; //~ERROR: mismatched types: expected `&[isize]`, found `[isize; 1]`
}

View File

@ -18,11 +18,11 @@ struct Foo;
trait Bar {}
pub fn main() {
// With a vec of ints.
// With a vec of isize.
let f1 = Fat { ptr: [1, 2, 3] };
let f2: &Fat<[int; 3]> = &f1;
let f3: &Fat<[uint]> = f2;
//~^ ERROR mismatched types: expected `&Fat<[uint]>`, found `&Fat<[int; 3]>`
let f2: &Fat<[isize; 3]> = &f1;
let f3: &Fat<[usize]> = f2;
//~^ ERROR mismatched types: expected `&Fat<[usize]>`, found `&Fat<[isize; 3]>`
// With a trait.
let f1 = Fat { ptr: Foo };

View File

@ -15,8 +15,8 @@ struct Fat<T: ?Sized> {
}
pub fn main() {
// With a vec of ints.
let f1: &Fat<[int]> = &Fat { ptr: [1, 2, 3] };
let f2: &Fat<[int; 3]> = f1;
//~^ ERROR mismatched types: expected `&Fat<[int; 3]>`, found `&Fat<[int]>`
// With a vec of isizes.
let f1: &Fat<[isize]> = &Fat { ptr: [1, 2, 3] };
let f2: &Fat<[isize; 3]> = f1;
//~^ ERROR mismatched types: expected `&Fat<[isize; 3]>`, found `&Fat<[isize]>`
}

View File

@ -14,10 +14,10 @@
trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
impl Foo<[int]> for uint { }
//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `[int]`
impl Foo<[isize]> for uint { }
//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `[isize]`
impl Foo<int> for [uint] { }
//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `[uint]`
impl Foo<isize> for [usize] { }
//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `[usize]`
pub fn main() { }

View File

@ -10,15 +10,15 @@
#![feature(unboxed_closures)]
fn needs_fn<F>(x: F) where F: Fn(int) -> int {}
fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
fn main() {
let _: () = (box |:_: int| {}) as Box<FnOnce(int)>; //~ ERROR object-safe
//~^ ERROR Box<core::ops::FnOnce(int)>
let _: () = (box |&:_: int, int| {}) as Box<Fn(int, int)>;
//~^ ERROR Box<core::ops::Fn(int, int)>
let _: () = (box |&mut:| -> int unimplemented!()) as Box<FnMut() -> int>;
//~^ ERROR Box<core::ops::FnMut() -> int>
let _: () = (box |:_: isize| {}) as Box<FnOnce(isize)>; //~ ERROR object-safe
//~^ ERROR Box<core::ops::FnOnce(isize)>
let _: () = (box |&:_: isize, isize| {}) as Box<Fn(isize, isize)>;
//~^ ERROR Box<core::ops::Fn(isize, isize)>
let _: () = (box |&mut:| -> isize unimplemented!()) as Box<FnMut() -> isize>;
//~^ ERROR Box<core::ops::FnMut() -> isize>
needs_fn(1i); //~ ERROR `core::ops::Fn(int) -> int`
needs_fn(1i); //~ ERROR `core::ops::Fn(isize) -> isize`
}

View File

@ -11,7 +11,7 @@
// Test that we use fully-qualified type names in error messages.
fn main() {
let x: Option<uint>;
let x: Option<usize>;
x = 5;
//~^ ERROR mismatched types: expected `core::option::Option<uint>`
//~^ ERROR mismatched types: expected `core::option::Option<usize>`
}

View File

@ -12,9 +12,9 @@
use std::option::Option;
fn bar(x: uint) -> Option<uint> {
fn bar(x: usize) -> Option<usize> {
return x;
//~^ ERROR mismatched types: expected `core::option::Option<uint>`
//~^ ERROR mismatched types: expected `core::option::Option<usize>`
}
fn main() {

View File

@ -18,22 +18,22 @@ struct HashMap<K, V, H = Hash<K>>;
fn main() {
// Ensure that the printed type doesn't include the default type params...
let _: Foo<int> = ();
//~^ ERROR mismatched types: expected `Foo<int>`, found `()`
let _: Foo<isize> = ();
//~^ ERROR mismatched types: expected `Foo<isize>`, found `()`
// ...even when they're present, but the same types as the defaults.
let _: Foo<int, B, C> = ();
//~^ ERROR mismatched types: expected `Foo<int>`, found `()`
let _: Foo<isize, B, C> = ();
//~^ ERROR mismatched types: expected `Foo<isize>`, found `()`
// Including cases where the default is using previous type params.
let _: HashMap<String, int> = ();
//~^ ERROR mismatched types: expected `HashMap<collections::string::String, int>`, found `()`
let _: HashMap<String, int, Hash<String>> = ();
//~^ ERROR mismatched types: expected `HashMap<collections::string::String, int>`, found `()`
let _: HashMap<String, isize> = ();
//~^ ERROR mismatched types: expected `HashMap<collections::string::String, isize>`, found `()`
let _: HashMap<String, isize, Hash<String>> = ();
//~^ ERROR mismatched types: expected `HashMap<collections::string::String, isize>`, found `()`
// But not when there's a different type in between.
let _: Foo<A, int, C> = ();
//~^ ERROR mismatched types: expected `Foo<A, int>`, found `()`
let _: Foo<A, isize, C> = ();
//~^ ERROR mismatched types: expected `Foo<A, isize>`, found `()`
// And don't print <> at all when there's just defaults.
let _: Foo<A, B, C> = ();

View File

@ -16,22 +16,22 @@ trait Foo<X> {
}
fn want_hrtb<T>()
where T : for<'a> Foo<&'a int>
where T : for<'a> Foo<&'a isize>
{
}
// AnyInt implements Foo<&'a int> for any 'a, so it is a match.
// AnyInt implements Foo<&'a isize> for any 'a, so it is a match.
struct AnyInt;
impl<'a> Foo<&'a int> for AnyInt { }
impl<'a> Foo<&'a isize> for AnyInt { }
fn give_any() {
want_hrtb::<AnyInt>()
}
// StaticInt only implements Foo<&'static int>, so it is an error.
// StaticInt only implements Foo<&'static isize>, so it is an error.
struct StaticInt;
impl Foo<&'static int> for StaticInt { }
impl Foo<&'static isize> for StaticInt { }
fn give_static() {
want_hrtb::<StaticInt>() //~ ERROR `for<'a> Foo<&'a int>` is not implemented
want_hrtb::<StaticInt>() //~ ERROR `for<'a> Foo<&'a isize>` is not implemented
}
fn main() { }

View File

@ -30,36 +30,36 @@ impl<'a,X,F> Bar<X> for &'a mut F
}
fn no_hrtb<'b,T>(mut t: T)
where T : Bar<&'b int>
where T : Bar<&'b isize>
{
// OK -- `T : Bar<&'b int>`, and thus the impl above ensures that
// `&mut T : Bar<&'b int>`.
// OK -- `T : Bar<&'b isize>`, and thus the impl above ensures that
// `&mut T : Bar<&'b isize>`.
no_hrtb(&mut t);
}
fn bar_hrtb<T>(mut t: T)
where T : for<'b> Bar<&'b int>
where T : for<'b> Bar<&'b isize>
{
// OK -- `T : for<'b> Bar<&'b int>`, and thus the impl above
// ensures that `&mut T : for<'b> Bar<&'b int>`. This is an
// OK -- `T : for<'b> Bar<&'b isize>`, and thus the impl above
// ensures that `&mut T : for<'b> Bar<&'b isize>`. This is an
// example of a "perfect forwarding" impl.
bar_hrtb(&mut t);
}
fn foo_hrtb_bar_not<'b,T>(mut t: T)
where T : for<'a> Foo<&'a int> + Bar<&'b int>
where T : for<'a> Foo<&'a isize> + Bar<&'b isize>
{
// Not OK -- The forwarding impl for `Foo` requires that `Bar` also
// be implemented. Thus to satisfy `&mut T : for<'a> Foo<&'a
// int>`, we require `T : for<'a> Bar<&'a int>`, but the where
// clause only specifies `T : Bar<&'b int>`.
foo_hrtb_bar_not(&mut t); //~ ERROR `for<'a> Bar<&'a int>` is not implemented for the type `T`
// isize>`, we require `T : for<'a> Bar<&'a isize>`, but the where
// clause only specifies `T : Bar<&'b isize>`.
foo_hrtb_bar_not(&mut t); //~ ERROR `for<'a> Bar<&'a isize>` is not implemented for the type `T`
}
fn foo_hrtb_bar_hrtb<T>(mut t: T)
where T : for<'a> Foo<&'a int> + for<'b> Bar<&'b int>
where T : for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>
{
// OK -- now we have `T : for<'b> Bar&'b int>`.
// OK -- now we have `T : for<'b> Bar&'b isize>`.
foo_hrtb_bar_hrtb(&mut t);
}

View File

@ -17,7 +17,7 @@ trait Foo<X> {
}
fn want_foo<T>()
where T : for<'a> Foo<&'a int>
where T : for<'a> Foo<&'a isize>
{
}
@ -28,7 +28,7 @@ struct SomeStruct<X> {
x: X
}
impl<'a,X> Foo<&'a int> for SomeStruct<X>
impl<'a,X> Foo<&'a isize> for SomeStruct<X>
where X : 'a
{
}
@ -36,8 +36,8 @@ impl<'a,X> Foo<&'a int> for SomeStruct<X>
fn one() {
// In fact there is no good reason for this to be an error, but
// whatever, I'm mostly concerned it doesn't ICE right now:
want_foo::<SomeStruct<uint>>();
//~^ ERROR requirement `for<'a> uint : 'a` is not satisfied
want_foo::<SomeStruct<usize>>();
//~^ ERROR requirement `for<'a> usize : 'a` is not satisfied
}
///////////////////////////////////////////////////////////////////////////
@ -47,13 +47,13 @@ struct AnotherStruct<X> {
x: X
}
impl<'a,X:'a> Foo<&'a int> for AnotherStruct<X>
impl<'a,X:'a> Foo<&'a isize> for AnotherStruct<X>
{
}
fn two() {
want_foo::<AnotherStruct<uint>>();
//~^ ERROR requirement `for<'a> uint : 'a` is not satisfied
want_foo::<AnotherStruct<usize>>();
//~^ ERROR requirement `for<'a> usize : 'a` is not satisfied
}
fn main() { }

View File

@ -9,6 +9,6 @@
// except according to those terms.
fn main() {
let x = if true { 10i } else { 10u };
//~^ ERROR if and else have incompatible types: expected `int`, found `uint`
let x = if true { 10is } else { 10us };
//~^ ERROR if and else have incompatible types: expected `isize`, found `usize`
}

View File

@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn f() -> int {
fn f() -> isize {
(return 1, return 2)
//~^ ERROR mismatched types: expected `int`, found `(_, _)` (expected int, found tuple)
//~^ ERROR mismatched types: expected `isize`, found `(_, _)` (expected isize, found tuple)
}
fn main() {}

View File

@ -10,5 +10,5 @@
fn main() {
let nil = ();
let _t = nil as uint; //~ ERROR: cast from nil: `()` as `uint`
let _t = nil as usize; //~ ERROR: cast from nil: `()` as `usize`
}

View File

@ -12,6 +12,6 @@
//! Test that makes sure wrongly-typed bench functions are rejected
// error-pattern:expected &-ptr, found int
// error-pattern:expected &-ptr, found isize
#[bench]
fn bar(x: int) { }
fn bar(x: isize) { }

View File

@ -12,15 +12,15 @@ use std::iter::{Range,range};
trait Itble<'r, T, I: Iterator<Item=T>> { fn iter(&'r self) -> I; }
impl<'r> Itble<'r, uint, Range<uint>> for (uint, uint) {
fn iter(&'r self) -> Range<uint> {
impl<'r> Itble<'r, usize, Range<usize>> for (usize, usize) {
fn iter(&'r self) -> Range<usize> {
let &(min, max) = self;
range(min, max)
}
}
fn check<'r, I: Iterator<Item=uint>, T: Itble<'r, uint, I>>(cont: &T) -> bool
//~^ HELP as shown: fn check<'r, I: Iterator<Item = uint>, T: Itble<'r, uint, I>>(cont: &'r T)
fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
//~^ HELP as shown: fn check<'r, I: Iterator<Item = usize>, T: Itble<'r, usize, I>>(cont: &'r T)
{
let cont_iter = cont.iter();
//~^ ERROR cannot infer an appropriate lifetime for autoref due to conflicting requirements
@ -35,5 +35,5 @@ fn check<'r, I: Iterator<Item=uint>, T: Itble<'r, uint, I>>(cont: &T) -> bool
fn main() {
check((3u, 5u));
//~^ ERROR mismatched types: expected `&_`, found `(uint, uint)` (expected &-ptr, found tuple)
//~^ ERROR mismatched types: expected `&_`, found `(usize, usize)` (expected &-ptr, found tuple)
}

View File

@ -14,8 +14,8 @@ fn bar(_s: u32) { }
fn main() {
foo(1*(1 as int));
//~^ ERROR: mismatched types: expected `i16`, found `int` (expected i16, found int)
//~^ ERROR: mismatched types: expected `i16`, found `isize` (expected i16, found isize)
bar(1*(1 as uint));
//~^ ERROR: mismatched types: expected `u32`, found `uint` (expected u32, found uint)
//~^ ERROR: mismatched types: expected `u32`, found `usize` (expected u32, found usize)
}

View File

@ -14,8 +14,8 @@ pub fn main() {
// The expected arm type `Option<T>` has one type parameter, while
// the actual arm `Result<T, E>` has two. typeck should not be
// tricked into looking up a non-existing second type parameter.
let _x: uint = match Some(1u) {
Ok(u) => u, //~ ERROR mismatched types: expected `core::option::Option<uint>`
Err(e) => panic!(e) //~ ERROR mismatched types: expected `core::option::Option<uint>`
let _x: usize = match Some(1us) {
Ok(u) => u, //~ ERROR mismatched types: expected `core::option::Option<usize>`
Err(e) => panic!(e) //~ ERROR mismatched types: expected `core::option::Option<usize>`
};
}

View File

@ -9,7 +9,7 @@
// except according to those terms.
fn main() {
let x: Box<int> = box 0;
let x: Box<isize> = box 0;
println!("{}", x + 1); //~ ERROR binary operation `+` cannot be applied to type `Box<int>`
println!("{}", x + 1); //~ ERROR binary operation `+` cannot be applied to type `Box<isize>`
}

View File

@ -11,7 +11,7 @@
#![deny(warnings)]
extern {
pub fn foo(x: (int)); //~ ERROR found rust type `int` in foreign module
pub fn foo(x: (isize)); //~ ERROR found rust type `isize` in foreign module
}
fn main() {

View File

@ -9,16 +9,16 @@
// except according to those terms.
fn main() {
let _foo = &[1u, 2] as [uint];
//~^ ERROR cast to unsized type: `&[uint; 2]` as `[uint]`
//~^^ HELP consider using an implicit coercion to `&[uint]` instead
let _foo = &[1u, 2] as [usize];
//~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]`
//~^^ HELP consider using an implicit coercion to `&[usize]` instead
let _bar = box 1u as std::fmt::Show;
//~^ ERROR cast to unsized type: `Box<uint>` as `core::fmt::Show`
//~^ ERROR cast to unsized type: `Box<usize>` as `core::fmt::Show`
//~^^ HELP did you mean `Box<core::fmt::Show>`?
let _baz = 1u as std::fmt::Show;
//~^ ERROR cast to unsized type: `uint` as `core::fmt::Show`
//~^ ERROR cast to unsized type: `usize` as `core::fmt::Show`
//~^^ HELP consider using a box or reference as appropriate
let _quux = [1u, 2] as [uint];
//~^ ERROR cast to unsized type: `[uint; 2]` as `[uint]`
let _quux = [1u, 2] as [usize];
//~^ ERROR cast to unsized type: `[usize; 2]` as `[usize]`
//~^^ HELP consider using a box or reference as appropriate
}

View File

@ -13,6 +13,6 @@ enum Test {
}
fn main() {
let _x = Test::Foo as *const int;
//~^ ERROR illegal cast; cast through an integer first: `Test` as `*const int`
let _x = Test::Foo as *const isize;
//~^ ERROR illegal cast; cast through an integer first: `Test` as `*const isize`
}

View File

@ -12,7 +12,7 @@
// and rejected.
fn main() {
(|&:| box *[0u].as_slice())();
(|&:| box *[0us].as_slice())();
//~^ ERROR cannot move out of dereference
//~^^ ERROR cannot move a value of type [uint]
//~^^ ERROR cannot move a value of type [usize]
}

View File

@ -13,15 +13,15 @@ struct Pair<T, V> (T, V);
impl Pair<
&str, //~ ERROR missing lifetime specifier
int
isize
> {
fn say(self: &Pair<&str, int>) {
//~^ ERROR mismatched types: expected `Pair<&'static str, int>`, found `Pair<&str, int>`
fn say(self: &Pair<&str, isize>) {
//~^ ERROR mismatched types: expected `Pair<&'static str, isize>`, found `Pair<&str, isize>`
println!("{}", self);
}
}
fn main() {
let result = &Pair("shane", 1i);
let result = &Pair("shane", 1is);
result.say();
}

View File

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn add_state(op: <int as HasState>::State) {
//~^ ERROR the trait `HasState` is not implemented for the type `int`
fn add_state(op: <isize as HasState>::State) {
//~^ ERROR the trait `HasState` is not implemented for the type `isize`
}
trait HasState {

View File

@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn bar(int_param: int) {}
fn bar(int_param: usize) {}
fn main() {
let foo: [u8; 4] = [1u8; 4u];
let foo: [u8; 4] = [1u8; 4us];
bar(foo);
//~^ ERROR mismatched types: expected `int`, found `[u8; 4]`
// (expected int, found vector)
//~^ ERROR mismatched types: expected `usize`, found `[u8; 4]`
// (expected usize, found vector)
}

View File

@ -10,9 +10,9 @@
// Regression test for issue #4968
const A: (int,int) = (4,2);
const A: (isize,isize) = (4,2);
fn main() {
match 42 { A => () }
//~^ ERROR mismatched types: expected `_`, found `(int, int)`
//~^ ERROR mismatched types: expected `_`, found `(isize, isize)`
// (expected integral variable, found tuple)
}

View File

@ -11,6 +11,6 @@
// Regression test for issue #5239
fn main() {
let x = |&: ref x: int| -> int { x += 1; };
//~^ ERROR binary assignment operation `+=` cannot be applied to type `&int`
let x = |&: ref x: isize| -> isize { x += 1; };
//~^ ERROR binary assignment operation `+=` cannot be applied to type `&isize`
}

View File

@ -11,43 +11,43 @@
// Test the mechanism for warning about possible missing `self` declarations.
trait CtxtFn {
fn f8(self, uint) -> uint;
fn f9(uint) -> uint; //~ NOTE candidate
fn f8(self, usize) -> usize;
fn f9(usize) -> usize; //~ NOTE candidate
}
trait OtherTrait {
fn f9(uint) -> uint; //~ NOTE candidate
fn f9(usize) -> usize; //~ NOTE candidate
}
// Note: this trait is not implemented, but we can't really tell
// whether or not an impl would match anyhow without a self
// declaration to match against, so we wind up printing it as a
// declaration to match against, so we wind up prisizeing it as a
// candidate. This seems not unreasonable -- perhaps the user meant to
// implement it, after all.
trait UnusedTrait {
fn f9(uint) -> uint; //~ NOTE candidate
fn f9(usize) -> usize; //~ NOTE candidate
}
impl CtxtFn for uint {
fn f8(self, i: uint) -> uint {
impl CtxtFn for usize {
fn f8(self, i: usize) -> usize {
i * 4u
}
fn f9(i: uint) -> uint {
fn f9(i: usize) -> usize {
i * 4u
}
}
impl OtherTrait for uint {
fn f9(i: uint) -> uint {
impl OtherTrait for usize {
fn f9(i: usize) -> usize {
i * 8u
}
}
struct MyInt(int);
struct Myisize(isize);
impl MyInt {
fn fff(i: int) -> int { //~ NOTE candidate
impl Myisize {
fn fff(i: isize) -> isize { //~ NOTE candidate
i
}
}
@ -64,17 +64,17 @@ impl ManyImplTrait for String {
}
}
impl ManyImplTrait for uint {}
impl ManyImplTrait for int {}
impl ManyImplTrait for usize {}
impl ManyImplTrait for isize {}
impl ManyImplTrait for char {}
impl ManyImplTrait for MyInt {}
impl ManyImplTrait for Myisize {}
fn no_param_bound(u: uint, m: MyInt) -> uint {
fn no_param_bound(u: usize, m: Myisize) -> usize {
u.f8(42) + u.f9(342) + m.fff(42)
//~^ ERROR type `uint` does not implement any method in scope named `f9`
//~^ ERROR type `usize` does not implement any method in scope named `f9`
//~^^ NOTE found defined static methods, maybe a `self` is missing?
//~^^^ ERROR type `MyInt` does not implement any method in scope named `fff`
//~^^^^ NOTE found defined static methods, maybe a `self` is missing?
//~^^^ ERROR type `Myisize` does not implement any method in scope named `fff`
//~^^^^ NOTE found defined static methods, maybe a `self` is missing?
}
fn param_bound<T: ManyImplTrait>(t: T) -> bool {

View File

@ -18,10 +18,10 @@ fn main() {
_ => ()
}
match &Some(42i) {
Some(x) => (), //~ ERROR expected `&core::option::Option<int>`,
match &Some(42is) {
Some(x) => (), //~ ERROR expected `&core::option::Option<isize>`,
// found `core::option::Option<_>`
None => () //~ ERROR expected `&core::option::Option<int>`,
None => () //~ ERROR expected `&core::option::Option<isize>`,
// found `core::option::Option<_>`
}
}

View File

@ -10,9 +10,9 @@
enum Foo {
A = 1i64,
//~^ ERROR mismatched types: expected `int`, found `i64`
//~^ ERROR mismatched types: expected `isize`, found `i64`
B = 2u8
//~^ ERROR mismatched types: expected `int`, found `u8`
//~^ ERROR mismatched types: expected `isize`, found `u8`
}
fn main() {}

View File

@ -9,7 +9,7 @@
// except according to those terms.
#[start]
fn start(argc: int, argv: *const *const u8, crate_map: *const u8) -> int {
fn start(argc: isize, argv: *const *const u8, crate_map: *const u8) -> isize {
//~^ ERROR incorrect number of function parameters
0
0
}

View File

@ -19,8 +19,8 @@ impl<K, V> Map<K, V> for HashMap<K, V> {}
// Test that trait types printed in error msgs include the type arguments.
fn main() {
let x: Box<HashMap<int, int>> = box HashMap::new();
let x: Box<Map<int, int>> = x;
let y: Box<Map<uint, int>> = box x;
//~^ ERROR the trait `Map<uint, int>` is not implemented
let x: Box<HashMap<isize, isize>> = box HashMap::new();
let x: Box<Map<isize, isize>> = x;
let y: Box<Map<usize, isize>> = box x;
//~^ ERROR the trait `Map<usize, isize>` is not implemented
}

View File

@ -20,5 +20,5 @@ fn main() {
let x = Foo;
Foo::bar(x); //~ERROR mismatched types: expected `&Foo`, found `Foo`
Foo::bar(&&x); //~ERROR mismatched types: expected `&Foo`, found `&&Foo`
Foo::bar(&42i); //~ERROR mismatched types: expected `&Foo`, found `&int`
Foo::bar(&42is); //~ERROR mismatched types: expected `&Foo`, found `&isize`
}

View File

@ -9,18 +9,18 @@
// except according to those terms.
fn main() {
let foo = &mut 1i;
let foo = &mut 1is;
// (separate lines to ensure the spans are accurate)
// SNAP b2085d9 uncomment this after the next snapshot
// NOTE(stage0) just in case tidy doesn't check snap's in tests
// let &_ // ~ ERROR expected `&mut int`, found `&_`
// let &_ // ~ ERROR expected `&mut isize`, found `&_`
// = foo;
let &mut _ = foo;
let bar = &1i;
let bar = &1is;
let &_ = bar;
let &mut _ //~ ERROR expected `&int`, found `&mut _`
let &mut _ //~ ERROR expected `&isize`, found `&mut _`
= bar;
}

View File

@ -18,5 +18,5 @@ fn main() {
// because the def_id associated with the type was
// not convertible to a path.
let x: int = noexporttypelib::foo();
//~^ ERROR expected `int`, found `core::option::Option<int>`
//~^ ERROR expected `isize`, found `core::option::Option<isize>`
}

View File

@ -11,9 +11,9 @@
fn let_in<T, F>(x: T, f: F) where F: FnOnce(T) {}
fn main() {
let_in(3u, |i| { assert!(i == 3i); });
//~^ ERROR expected `uint`, found `int`
let_in(3u, |i| { assert!(i == 3is); });
//~^ ERROR expected `usize`, found `isize`
let_in(3i, |i| { assert!(i == 3u); });
//~^ ERROR expected `int`, found `uint`
let_in(3i, |i| { assert!(i == 3us); });
//~^ ERROR expected `isize`, found `usize`
}

View File

@ -12,7 +12,7 @@
// Check that we correctly infer that b and c must be region
// parameterized because they reference a which requires a region.
type a<'a> = &'a int;
type a<'a> = &'a isize;
type b<'a> = Box<a<'a>>;
struct c<'a> {
@ -30,7 +30,8 @@ impl<'a> set_f<'a> for c<'a> {
}
fn set_f_bad(&mut self, b: Box<b>) {
self.f = b; //~ ERROR mismatched types: expected `Box<Box<&'a int>>`, found `Box<Box<&int>>`
self.f = b;
//~^ ERROR mismatched types: expected `Box<Box<&'a isize>>`, found `Box<Box<&isize>>`
}
}

View File

@ -15,13 +15,13 @@ fn main() {
let a = [0; n]; //~ ERROR expected constant integer for repeat count, found variable
let b = [0; ()];
//~^ ERROR expected constant integer for repeat count, found non-constant expression
//~^^ ERROR: expected `uint`, found `()`
//~^^ ERROR: expected `usize`, found `()`
let c = [0; true]; //~ ERROR expected positive integer for repeat count, found boolean
//~^ ERROR: expected `uint`, found `bool`
//~^ ERROR: expected `usize`, found `bool`
let d = [0; 0.5]; //~ ERROR expected positive integer for repeat count, found float
//~^ ERROR: expected `uint`, found `_`
//~^ ERROR: expected `usize`, found `_`
let e = [0; "foo"]; //~ ERROR expected positive integer for repeat count, found string
//~^ ERROR: expected `uint`, found `&'static str`
//~^ ERROR: expected `usize`, found `&'static str`
let f = [0; -4];
//~^ ERROR expected positive integer for repeat count, found negative integer
let f = [0u; -1];

View File

@ -24,33 +24,33 @@ type PairF<U> = Pair<f32,U>;
fn main() {
let pt = PointF {
//~^ ERROR expected f32, found int
x: 1i,
y: 2i,
//~^ ERROR expected f32, found isize
x: 1is,
y: 2is,
};
let pt2 = Point::<f32> {
//~^ ERROR expected f32, found int
x: 3i,
y: 4i,
//~^ ERROR expected f32, found isize
x: 3is,
y: 4is,
};
let pair = PairF {
//~^ ERROR expected f32, found int
x: 5i,
y: 6i,
//~^ ERROR expected f32, found isize
x: 5is,
y: 6is,
};
let pair2 = PairF::<int> {
//~^ ERROR expected f32, found int
x: 7i,
y: 8i,
let pair2 = PairF::<isize> {
//~^ ERROR expected f32, found isize
x: 7is,
y: 8is,
};
let pt3 = PointF::<int> {
let pt3 = PointF::<isize> {
//~^ ERROR wrong number of type arguments
x: 9i,
y: 10i,
x: 9is,
y: 10is,
};
}

View File

@ -29,7 +29,7 @@ trait Foo {
fn test_error8_fn<T: B>(&self);
}
impl Foo for int {
impl Foo for isize {
// invalid bound for T, was defined as Eq in trait
fn test_error1_fn<T: Ord>(&self) {}
//~^ ERROR in method `test_error1_fn`, type parameter 0 requires bound `core::cmp::Ord`
@ -66,12 +66,12 @@ impl Foo for int {
trait Getter<T> { }
trait Trait {
fn method<G:Getter<int>>();
fn method<G:Getter<isize>>();
}
impl Trait for uint {
fn method<G: Getter<uint>>() {}
//~^ ERROR in method `method`, type parameter 0 requires bound `Getter<uint>`
impl Trait for usize {
fn method<G: Getter<usize>>() {}
//~^ ERROR in method `method`, type parameter 0 requires bound `Getter<usize>`
}
fn main() {}

View File

@ -24,7 +24,7 @@ impl Trait<&'static str> for Struct {
}
fn main() {
let s: Box<Trait<int>> = box Struct { person: "Fred" };
//~^ ERROR the trait `Trait<int>` is not implemented for the type `Struct`
let s: Box<Trait<isize>> = box Struct { person: "Fred" };
//~^ ERROR the trait `Trait<isize>` is not implemented for the type `Struct`
s.f(1);
}

View File

@ -21,6 +21,6 @@ impl<'a> T+'a {
impl T for int {}
fn main() {
let x = &42i;
x.foo(); //~ERROR: type `&int` does not implement any method in scope named `foo`
let x = &42is;
x.foo(); //~ERROR: type `&isize` does not implement any method in scope named `foo`
}

View File

@ -10,12 +10,12 @@
// Issue #6155
fn first((value, _): (int, f64)) -> int { value }
fn first((value, _): (isize, f64)) -> isize { value }
fn main() {
let y = first ((1,2.0,3));
//~^ ERROR expected a tuple with 2 elements, found one with 3 elements
let y = first ((1,));
//~^ ERROR expected `(int, f64)`, found `(int,)`
//~^ ERROR expected `(isize, f64)`, found `(isize,)`
}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
struct Point(int, int);
struct Point(isize, isize);
fn main() {
let origin = Point(0, 0);
@ -16,9 +16,9 @@ fn main() {
origin.1;
origin.2;
//~^ ERROR attempted out-of-bounds tuple index `2` on type `Point`
let tuple = (0i, 0i);
let tuple = (0is, 0is);
tuple.0;
tuple.1;
tuple.2;
//~^ ERROR attempted out-of-bounds tuple index `2` on type `(int, int)`
//~^ ERROR attempted out-of-bounds tuple index `2` on type `(isize, isize)`
}

View File

@ -21,12 +21,12 @@ fn main() {
identity_u16(y);
//~^ ERROR mismatched types: expected `u16`, found `i32`
let a = 3i;
let a = 3is;
fn identity_i(n: int) -> int { n }
fn identity_i(n: isize) -> int { n }
identity_i(a); // ok
identity_u16(a);
//~^ ERROR mismatched types: expected `u16`, found `int`
//~^ ERROR mismatched types: expected `u16`, found `isize`
}

View File

@ -10,6 +10,6 @@
// Checking that the compiler reports multiple type errors at once
// error-pattern:mismatched types: expected `bool`
// error-pattern:mismatched types: expected `int`
// error-pattern:mismatched types: expected `isize`
fn main() { let a: bool = 1i; let b: int = true; }
fn main() { let a: bool = 1is; let b: isize = true; }

View File

@ -18,12 +18,12 @@ pub fn main() {
}
fn test1() {
let x: Foo<_> = Bar::<uint>;
//~^ ERROR mismatched types: expected `Foo<_>`, found `Bar<uint>`
let y: Foo<uint> = x;
let x: Foo<_> = Bar::<usize>;
//~^ ERROR mismatched types: expected `Foo<_>`, found `Bar<usize>`
let y: Foo<usize> = x;
}
fn test2() {
let x: Foo<_> = Bar::<uint>;
//~^ ERROR mismatched types: expected `Foo<_>`, found `Bar<uint>`
let x: Foo<_> = Bar::<usize>;
//~^ ERROR mismatched types: expected `Foo<_>`, found `Bar<usize>`
}

View File

@ -13,24 +13,24 @@ extern "stdcall" {
}
extern {
fn foo(f: int, x: u8, ...);
fn foo(f: isize, x: u8, ...);
}
extern "C" fn bar(f: int, x: u8) {}
extern "C" fn bar(f: isize, x: u8) {}
fn main() {
unsafe {
foo(); //~ ERROR: this function takes at least 2 parameters but 0 parameters were supplied
foo(1); //~ ERROR: this function takes at least 2 parameters but 1 parameter was supplied
let x: unsafe extern "C" fn(f: int, x: u8) = foo;
//~^ ERROR: mismatched types: expected `unsafe extern "C" fn(int, u8)`
// , found `unsafe extern "C" fn(int, u8, ...)`
let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
//~^ ERROR: mismatched types: expected `unsafe extern "C" fn(isize, u8)`
// , found `unsafe extern "C" fn(isize, u8, ...)`
// (expected non-variadic fn, found variadic function)
let y: unsafe extern "C" fn(f: int, x: u8, ...) = bar;
//~^ ERROR: mismatched types: expected `unsafe extern "C" fn(int, u8, ...)`
// , found `extern "C" extern fn(int, u8)`
let y: unsafe extern "C" fn(f: isize, x: u8, ...) = bar;
//~^ ERROR: mismatched types: expected `unsafe extern "C" fn(isize, u8, ...)`
// , found `extern "C" extern fn(isize, u8)`
// (expected variadic fn, found non-variadic function)
foo(1, 2, 3f32); //~ ERROR: can't pass an f32 to variadic function, cast to c_double

View File

@ -13,9 +13,9 @@
mod xx {
extern {
pub fn strlen(str: *const u8) -> uint; //~ ERROR found rust type `uint`
pub fn foo(x: int, y: uint); //~ ERROR found rust type `int`
//~^ ERROR found rust type `uint`
pub fn strlen(str: *const u8) -> usize; //~ ERROR found rust type `usize`
pub fn foo(x: isize, y: usize); //~ ERROR found rust type `isize`
//~^ ERROR found rust type `usize`
}
}

View File

@ -16,7 +16,7 @@
// gdb-command:whatis 'basic-types-globals-metadata::B'
// gdb-check:type = bool
// gdb-command:whatis 'basic-types-globals-metadata::I'
// gdb-check:type = int
// gdb-check:type = isize
// gdb-command:whatis 'basic-types-globals-metadata::C'
// gdb-check:type = char
// gdb-command:whatis 'basic-types-globals-metadata::I8'
@ -28,7 +28,7 @@
// gdb-command:whatis 'basic-types-globals-metadata::I64'
// gdb-check:type = i64
// gdb-command:whatis 'basic-types-globals-metadata::U'
// gdb-check:type = uint
// gdb-check:type = usize
// gdb-command:whatis 'basic-types-globals-metadata::U8'
// gdb-check:type = u8
// gdb-command:whatis 'basic-types-globals-metadata::U16'

View File

@ -18,7 +18,7 @@
// gdb-command:whatis b
// gdb-check:type = bool
// gdb-command:whatis i
// gdb-check:type = int
// gdb-check:type = isize
// gdb-command:whatis c
// gdb-check:type = char
// gdb-command:whatis i8
@ -30,7 +30,7 @@
// gdb-command:whatis i64
// gdb-check:type = i64
// gdb-command:whatis u
// gdb-check:type = uint
// gdb-check:type = usize
// gdb-command:whatis u8
// gdb-check:type = u8
// gdb-command:whatis u16
@ -53,13 +53,13 @@
fn main() {
let unit: () = ();
let b: bool = false;
let i: int = -1;
let i: isize = -1;
let c: char = 'a';
let i8: i8 = 68;
let i16: i16 = -16;
let i32: i32 = -32;
let i64: i64 = -64;
let u: uint = 1;
let u: usize = 1;
let u8: u8 = 100;
let u16: u16 = 16;
let u32: u32 = 32;

View File

@ -28,13 +28,13 @@
// gdb-check:$3 = {RUST$ENCODED$ENUM$1$Empty = {454545, 0x87654321, 9988}}
// gdb-command:print empty_gdb->discr
// gdb-check:$4 = (int *) 0x0
// gdb-check:$4 = (isize *) 0x0
// gdb-command:print droid
// gdb-check:$5 = {RUST$ENCODED$ENUM$2$Void = {id = 675675, range = 10000001, internals = 0x43218765}}
// gdb-command:print void_droid_gdb->internals
// gdb-check:$6 = (int *) 0x0
// gdb-check:$6 = (isize *) 0x0
// gdb-command:continue
@ -81,25 +81,25 @@
// this case (by casting the value to a memory-equivalent struct).
enum MoreFields<'a> {
Full(u32, &'a int, i16),
Full(u32, &'a isize, i16),
Empty
}
struct MoreFieldsRepr<'a> {
a: u32,
discr: &'a int,
discr: &'a isize,
b: i16
}
enum NamedFields<'a> {
Droid { id: i32, range: i64, internals: &'a int },
Droid { id: i32, range: i64, internals: &'a isize },
Void
}
struct NamedFieldsRepr<'a> {
id: i32,
range: i64,
internals: &'a int
internals: &'a isize
}
fn main() {

View File

@ -24,7 +24,7 @@
// gdb-check:type = struct GenericStruct<type-names::Mod1::Struct2, type-names::Mod1::Mod2::Struct3>
// gdb-command:whatis generic_struct2
// gdb-check:type = struct GenericStruct<type-names::Struct1, extern "fastcall" fn(int) -> uint>
// gdb-check:type = struct GenericStruct<type-names::Struct1, extern "fastcall" fn(isize) -> usize>
// gdb-command:whatis mod_struct
// gdb-check:type = struct Struct2
@ -79,22 +79,22 @@
// RAW POINTERS
// gdb-command:whatis mut_ptr1
// gdb-check:type = struct (*mut type-names::Struct1, int)
// gdb-check:type = struct (*mut type-names::Struct1, isize)
// gdb-command:whatis mut_ptr2
// gdb-check:type = struct (*mut int, int)
// gdb-check:type = struct (*mut isize, isize)
// gdb-command:whatis mut_ptr3
// gdb-check:type = struct (*mut type-names::Mod1::Mod2::Enum3<type-names::Struct1>, int)
// gdb-check:type = struct (*mut type-names::Mod1::Mod2::Enum3<type-names::Struct1>, isize)
// gdb-command:whatis const_ptr1
// gdb-check:type = struct (*const type-names::Struct1, int)
// gdb-check:type = struct (*const type-names::Struct1, isize)
// gdb-command:whatis const_ptr2
// gdb-check:type = struct (*const int, int)
// gdb-check:type = struct (*const isize, isize)
// gdb-command:whatis const_ptr3
// gdb-check:type = struct (*const type-names::Mod1::Mod2::Enum3<type-names::Struct1>, int)
// gdb-check:type = struct (*const type-names::Mod1::Mod2::Enum3<type-names::Struct1>, isize)
// VECTORS
@ -102,10 +102,10 @@
// gdb-check:type = struct ([type-names::Struct1; 3], i16)
// gdb-command:whatis fixed_size_vec2
// gdb-check:type = struct ([uint; 3], i16)
// gdb-check:type = struct ([usize; 3], i16)
// gdb-command:whatis slice1
// gdb-check:type = struct &[uint]
// gdb-check:type = struct &[usize]
// gdb-command:whatis slice2
// gdb-check:type = struct &[type-names::Mod1::Enum2]
@ -128,50 +128,50 @@
// gdb-check:type = struct &Trait2<type-names::Struct1, type-names::Struct1>
// gdb-command:whatis generic_mut_ref_trait
// gdb-check:type = struct &mut Trait2<type-names::Mod1::Mod2::Struct3, type-names::GenericStruct<uint, int>>
// gdb-check:type = struct &mut Trait2<type-names::Mod1::Mod2::Struct3, type-names::GenericStruct<usize, isize>>
// BARE FUNCTIONS
// gdb-command:whatis rust_fn
// gdb-check:type = struct (fn(core::option::Option<int>, core::option::Option<&type-names::Mod1::Struct2>), uint)
// gdb-check:type = struct (fn(core::option::Option<isize>, core::option::Option<&type-names::Mod1::Struct2>), usize)
// gdb-command:whatis extern_c_fn
// gdb-check:type = struct (extern "C" fn(int), uint)
// gdb-check:type = struct (extern "C" fn(isize), usize)
// gdb-command:whatis unsafe_fn
// gdb-check:type = struct (unsafe fn(core::result::Result<char, f64>), uint)
// gdb-check:type = struct (unsafe fn(core::result::Result<char, f64>), usize)
// gdb-command:whatis extern_stdcall_fn
// gdb-check:type = struct (extern "stdcall" fn(), uint)
// gdb-check:type = struct (extern "stdcall" fn(), usize)
// gdb-command:whatis rust_fn_with_return_value
// gdb-check:type = struct (fn(f64) -> uint, uint)
// gdb-check:type = struct (fn(f64) -> usize, usize)
// gdb-command:whatis extern_c_fn_with_return_value
// gdb-check:type = struct (extern "C" fn() -> type-names::Struct1, uint)
// gdb-check:type = struct (extern "C" fn() -> type-names::Struct1, usize)
// gdb-command:whatis unsafe_fn_with_return_value
// gdb-check:type = struct (unsafe fn(type-names::GenericStruct<u16, u8>) -> type-names::Mod1::Struct2, uint)
// gdb-check:type = struct (unsafe fn(type-names::GenericStruct<u16, u8>) -> type-names::Mod1::Struct2, usize)
// gdb-command:whatis extern_stdcall_fn_with_return_value
// gdb-check:type = struct (extern "stdcall" fn(Box<int>) -> uint, uint)
// gdb-check:type = struct (extern "stdcall" fn(Box<isize>) -> usize, usize)
// gdb-command:whatis generic_function_int
// gdb-check:type = struct (fn(int) -> int, uint)
// gdb-check:type = struct (fn(isize) -> isize, usize)
// gdb-command:whatis generic_function_struct3
// gdb-check:type = struct (fn(type-names::Mod1::Mod2::Struct3) -> type-names::Mod1::Mod2::Struct3, uint)
// gdb-check:type = struct (fn(type-names::Mod1::Mod2::Struct3) -> type-names::Mod1::Mod2::Struct3, usize)
// gdb-command:whatis variadic_function
// gdb-check:type = struct (unsafe extern "C" fn(*const u8, ...) -> int, uint)
// gdb-check:type = struct (unsafe extern "C" fn(*const u8, ...) -> isize, usize)
// CLOSURES
// gdb-command:whatis closure1
// gdb-check:type = struct (closure, uint)
// gdb-check:type = struct (closure, usize)
// gdb-command:whatis closure2
// gdb-check:type = struct (closure, uint)
// gdb-check:type = struct (closure, usize)
#![omit_gdb_pretty_printer_section]
@ -183,7 +183,7 @@ struct GenericStruct<T1, T2>;
enum Enum1 {
Variant1_1,
Variant1_2(int)
Variant1_2(isize)
}
mod Mod1 {
@ -209,23 +209,23 @@ mod Mod1 {
trait Trait1 { }
trait Trait2<T1, T2> { }
impl Trait1 for int {}
impl<T1, T2> Trait2<T1, T2> for int {}
impl Trait1 for isize {}
impl<T1, T2> Trait2<T1, T2> for isize {}
fn rust_fn(_: Option<int>, _: Option<&Mod1::Struct2>) {}
extern "C" fn extern_c_fn(_: int) {}
fn rust_fn(_: Option<isize>, _: Option<&Mod1::Struct2>) {}
extern "C" fn extern_c_fn(_: isize) {}
unsafe fn unsafe_fn(_: Result<char, f64>) {}
extern "stdcall" fn extern_stdcall_fn() {}
fn rust_fn_with_return_value(_: f64) -> uint { 4 }
fn rust_fn_with_return_value(_: f64) -> usize { 4 }
extern "C" fn extern_c_fn_with_return_value() -> Struct1 { Struct1 }
unsafe fn unsafe_fn_with_return_value(_: GenericStruct<u16, u8>) -> Mod1::Struct2 { Mod1::Struct2 }
extern "stdcall" fn extern_stdcall_fn_with_return_value(_: Box<int>) -> uint { 0 }
extern "stdcall" fn extern_stdcall_fn_with_return_value(_: Box<isize>) -> usize { 0 }
fn generic_function<T>(x: T) -> T { x }
extern {
fn printf(_:*const u8, ...) -> int;
fn printf(_:*const u8, ...) -> isize;
}
// In many of the cases below, the type that is actually under test is wrapped
@ -240,7 +240,7 @@ fn main() {
// Structs
let simple_struct = Struct1;
let generic_struct1: GenericStruct<Mod1::Struct2, Mod1::Mod2::Struct3> = GenericStruct;
let generic_struct2: GenericStruct<Struct1, extern "fastcall" fn(int) -> uint> = GenericStruct;
let generic_struct2: GenericStruct<Struct1, extern "fastcall" fn(isize) -> usize> = GenericStruct;
let mod_struct = Mod1::Struct2;
// Enums
@ -269,13 +269,13 @@ fn main() {
let mut_ref2 = (&mut mut_generic_struct, 0i32);
// Raw Pointers
let mut_ptr1: (*mut Struct1, int) = (ptr::null_mut(), 0);
let mut_ptr2: (*mut int, int) = (ptr::null_mut(), 0);
let mut_ptr3: (*mut Mod1::Mod2::Enum3<Struct1>, int) = (ptr::null_mut(), 0);
let mut_ptr1: (*mut Struct1, isize) = (ptr::null_mut(), 0);
let mut_ptr2: (*mut isize, isize) = (ptr::null_mut(), 0);
let mut_ptr3: (*mut Mod1::Mod2::Enum3<Struct1>, isize) = (ptr::null_mut(), 0);
let const_ptr1: (*const Struct1, int) = (ptr::null(), 0);
let const_ptr2: (*const int, int) = (ptr::null(), 0);
let const_ptr3: (*const Mod1::Mod2::Enum3<Struct1>, int) = (ptr::null(), 0);
let const_ptr1: (*const Struct1, isize) = (ptr::null(), 0);
let const_ptr2: (*const isize, isize) = (ptr::null(), 0);
let const_ptr3: (*const Mod1::Mod2::Enum3<Struct1>, isize) = (ptr::null(), 0);
// Vectors
let fixed_size_vec1 = ([Struct1, Struct1, Struct1], 0i16);
@ -297,7 +297,7 @@ fn main() {
let mut generic_mut_ref_trait_impl = 0i;
let generic_mut_ref_trait = (&mut generic_mut_ref_trait_impl) as
&mut Trait2<Mod1::Mod2::Struct3, GenericStruct<uint, int>>;
&mut Trait2<Mod1::Mod2::Struct3, GenericStruct<usize, isize>>;
// Bare Functions
let rust_fn = (rust_fn, 0u);
@ -310,7 +310,7 @@ fn main() {
let unsafe_fn_with_return_value = (unsafe_fn_with_return_value, 0u);
let extern_stdcall_fn_with_return_value = (extern_stdcall_fn_with_return_value, 0u);
let generic_function_int = (generic_function::<int>, 0u);
let generic_function_int = (generic_function::<isize>, 0u);
let generic_function_struct3 = (generic_function::<Mod1::Mod2::Struct3>, 0u);
let variadic_function = (printf, 0u);
@ -321,7 +321,7 @@ fn main() {
// how that maps to rustc's internal representation of these forms.
// Once closures have reached their 1.0 form, the tests below should
// probably be expanded.
let closure1 = (|&: x:int| {}, 0u);
let closure1 = (|&: x:isize| {}, 0u);
let closure2 = (|&: x:i8, y: f32| { (x as f32) + y }, 0u);
zzz(); // #break

View File

@ -20,18 +20,18 @@ use std::prelude::v1::*;
// #4264 fixed-length vector types
pub fn foo(_: [int; (3 as uint)]) { }
pub fn foo(_: [isize; (3 as usize)]) { }
pub fn bar() {
const FOO: uint = ((5u as uint) - (4u as uint) as uint);
let _: [(); (FOO as uint)] = ([(() as ())] as [(); 1]);
const FOO: usize = ((5us as usize) - (4us as usize) as usize);
let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
let _: [(); (1u as uint)] = ([(() as ())] as [(); 1]);
let _: [(); (1us as usize)] = ([(() as ())] as [(); 1]);
let _ =
(((&((([(1i as int), (2 as int), (3 as int)] as [int; 3])) as
[int; 3]) as &[int; 3]) as *const _ as *const [int; 3]) as
*const [int; (3u as uint)] as *const [int; 3]);
(((&((([(1is as isize), (2 as isize), (3 as isize)] as [isize; 3])) as
[isize; 3]) as &[isize; 3]) as *const _ as *const [isize; 3])
as *const [isize; (3us as usize)] as *const [isize; 3]);
@ -81,18 +81,19 @@ pub fn bar() {
core::fmt::Arguments<'_>))
as collections::string::String);
}
pub type Foo = [int; (3u as uint)];
pub type Foo = [isize; (3us as usize)];
pub struct Bar {
pub x: [int; (3u as uint)],
pub x: [isize; (3us as usize)],
}
pub struct TupleBar([int; (4u as uint)]);
pub enum Baz { BazVariant([int; (5u as uint)]), }
pub struct TupleBar([isize; (4us as usize)]);
pub enum Baz { BazVariant([isize; (5us as usize)]), }
pub fn id<T>(x: T) -> T { (x as T) }
pub fn use_id() {
let _ =
((id::<[int; (3u as uint)]> as
fn([int; 3]) -> [int; 3] {id})(([(1 as int), (2 as int),
(3 as int)] as [int; 3])) as
[int; 3]);
((id::<[isize; (3us as usize)]> as
fn([isize; 3]) -> [isize; 3] {id})(([(1 as isize), (2 as isize),
(3 as isize)] as
[isize; 3])) as
[isize; 3]);
}
fn main() { }

View File

@ -14,35 +14,35 @@
// #4264 fixed-length vector types
pub fn foo(_: [int; 3]) {}
pub fn foo(_: [isize; 3]) {}
pub fn bar() {
const FOO: uint = 5u - 4u;
const FOO: usize = 5us - 4us;
let _: [(); FOO] = [()];
let _ : [(); 1u] = [()];
let _ : [(); 1us] = [()];
let _ = &([1i,2,3]) as *const _ as *const [int; 3u];
let _ = &([1is,2,3]) as *const _ as *const [isize; 3us];
format!("test");
}
pub type Foo = [int; 3u];
pub type Foo = [isize; 3us];
pub struct Bar {
pub x: [int; 3u]
pub x: [isize; 3us]
}
pub struct TupleBar([int; 4u]);
pub struct TupleBar([isize; 4us]);
pub enum Baz {
BazVariant([int; 5u])
BazVariant([isize; 5us])
}
pub fn id<T>(x: T) -> T { x }
pub fn use_id() {
let _ = id::<[int; 3u]>([1,2,3]);
let _ = id::<[isize; 3us]>([1,2,3]);
}

View File

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:assertion failed: 1i == 2
// error-pattern:assertion failed: 1is == 2
fn main() {
assert!(1i == 2);
assert!(1is == 2);
}

View File

@ -8,8 +8,5 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:1i == 2
fn main() { assert!((1i == 2)); }
// error-pattern:1is == 2
fn main() { assert!((1is == 2)); }

View File

@ -1,9 +1,9 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 1i"];
N3[label="stmt 1i;"];
N4[label="block { 1i; }"];
N2[label="expr 1is"];
N3[label="stmt 1is;"];
N4[label="block { 1is; }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,11 +1,11 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 3i"];
N2[label="expr 3is"];
N3[label="expr 4"];
N4[label="expr 3i + 4"];
N5[label="stmt 3i + 4;"];
N6[label="block { 3i + 4; }"];
N4[label="expr 3is + 4"];
N5[label="stmt 3is + 4;"];
N6[label="block { 3is + 4; }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,10 +1,10 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 4i"];
N2[label="expr 4is"];
N3[label="local _x"];
N4[label="stmt let _x = 4i;"];
N5[label="block { let _x = 4i; }"];
N4[label="stmt let _x = 4is;"];
N5[label="block { let _x = 4is; }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,14 +1,14 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 5i"];
N3[label="expr 55i"];
N4[label="expr (5i, 55i)"];
N2[label="expr 5is"];
N3[label="expr 55is"];
N4[label="expr (5is, 55is)"];
N5[label="local _x"];
N6[label="local _y"];
N7[label="pat (_x, _y)"];
N8[label="stmt let (_x, _y) = (5i, 55i);"];
N9[label="block { let (_x, _y) = (5i, 55i); }"];
N8[label="stmt let (_x, _y) = (5is, 55is);"];
N9[label="block { let (_x, _y) = (5is, 55is); }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,12 +1,12 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 7i"];
N3[label="expr 77i"];
N4[label="expr 777i"];
N5[label="expr 7777i"];
N6[label="expr [7i, 77i, 777i, 7777i]"];
N7[label="expr match [7i, 77i, 777i, 7777i] { [x, y, ..] => x + y, }"];
N2[label="expr 7is"];
N3[label="expr 77is"];
N4[label="expr 777is"];
N5[label="expr 7777is"];
N6[label="expr [7is, 77is, 777is, 7777is]"];
N7[label="expr match [7is, 77is, 777is, 7777is] { [x, y, ..] => x + y, }"];
N8[label="(dummy_node)"];
N9[label="local x"];
N10[label="local y"];
@ -15,8 +15,8 @@ digraph block {
N13[label="expr x"];
N14[label="expr y"];
N15[label="expr x + y"];
N16[label="stmt match [7i, 77i, 777i, 7777i] { [x, y, ..] => x + y, };"];
N17[label="block { match [7i, 77i, 777i, 7777i] { [x, y, ..] => x + y, }; }"];
N16[label="stmt match [7is, 77is, 777is, 7777is] { [x, y, ..] => x + y, };"];
N17[label="block { match [7is, 77is, 777is, 7777is] { [x, y, ..] => x + y, }; }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,21 +1,21 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 8i"];
N2[label="expr 8is"];
N3[label="local x"];
N4[label="stmt let x = 8i;"];
N4[label="stmt let x = 8is;"];
N5[label="local _y"];
N6[label="stmt let _y;"];
N7[label="expr x"];
N8[label="expr 88i"];
N9[label="expr x > 88i"];
N10[label="expr 888i"];
N8[label="expr 88is"];
N9[label="expr x > 88is"];
N10[label="expr 888is"];
N11[label="expr _y"];
N12[label="expr _y = 888i"];
N13[label="stmt _y = 888i;"];
N14[label="block { _y = 888i; }"];
N15[label="expr if x > 88i { _y = 888i; }"];
N16[label="block { let x = 8i; let _y; if x > 88i { _y = 888i; } }"];
N12[label="expr _y = 888is"];
N13[label="stmt _y = 888is;"];
N14[label="block { _y = 888is; }"];
N15[label="expr if x > 88is { _y = 888is; }"];
N16[label="block { let x = 8is; let _y; if x > 88is { _y = 888is; } }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,29 +1,29 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 91i"];
N2[label="expr 91is"];
N3[label="local x"];
N4[label="stmt let x = 91i;"];
N4[label="stmt let x = 91is;"];
N5[label="local _y"];
N6[label="stmt let _y;"];
N7[label="expr x"];
N8[label="expr 92i"];
N9[label="expr x > 92i"];
N10[label="expr 93i"];
N8[label="expr 92is"];
N9[label="expr x > 92is"];
N10[label="expr 93is"];
N11[label="expr _y"];
N12[label="expr _y = 93i"];
N13[label="stmt _y = 93i;"];
N14[label="block { _y = 93i; }"];
N15[label="expr 94i"];
N16[label="expr 95i"];
N17[label="expr 94i + 95i"];
N12[label="expr _y = 93is"];
N13[label="stmt _y = 93is;"];
N14[label="block { _y = 93is; }"];
N15[label="expr 94is"];
N16[label="expr 95is"];
N17[label="expr 94is + 95is"];
N18[label="expr _y"];
N19[label="expr _y = 94i + 95i"];
N20[label="stmt _y = 94i + 95i;"];
N21[label="block { _y = 94i + 95i; }"];
N22[label="expr { _y = 94i + 95i; }"];
N23[label="expr if x > 92i { _y = 93i; } else { _y = 94i + 95i; }"];
N24[label="block { let x = 91i; let _y; if x > 92i { _y = 93i; } else { _y = 94i + 95i; } }"];
N19[label="expr _y = 94is + 95is"];
N20[label="stmt _y = 94is + 95is;"];
N21[label="block { _y = 94is + 95is; }"];
N22[label="expr { _y = 94is + 95is; }"];
N23[label="expr if x > 92is { _y = 93is; } else { _y = 94is + 95is; }"];
N24[label="block {\l let x = 91is;\l let _y;\l if x > 92is { _y = 93is; } else { _y = 94is + 95is; }\l}\l"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -9,10 +9,10 @@
// except according to those terms.
pub fn expr_if_twoarm_9() {
let x = 91i; let _y;
if x > 92i {
_y = 93i;
let x = 91is; let _y;
if x > 92is {
_y = 93is;
} else {
_y = 94i+95i;
_y = 94is+95is;
}
}

View File

@ -1,20 +1,20 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 10i"];
N2[label="expr 10is"];
N3[label="local mut x"];
N4[label="stmt let mut x = 10i;"];
N4[label="stmt let mut x = 10is;"];
N5[label="(dummy_node)"];
N6[label="expr x"];
N7[label="expr 0i"];
N8[label="expr x > 0i"];
N9[label="expr while x > 0i { x -= 1i; }"];
N10[label="expr 1i"];
N7[label="expr 0is"];
N8[label="expr x > 0is"];
N9[label="expr while x > 0is { x -= 1is; }"];
N10[label="expr 1is"];
N11[label="expr x"];
N12[label="expr x -= 1i"];
N13[label="stmt x -= 1i;"];
N14[label="block { x -= 1i; }"];
N15[label="block { let mut x = 10i; while x > 0i { x -= 1i; } }"];
N12[label="expr x -= 1is"];
N13[label="stmt x -= 1is;"];
N14[label="block { x -= 1is; }"];
N15[label="block { let mut x = 10is; while x > 0is { x -= 1is; } }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,20 +1,20 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 11i"];
N2[label="expr 11is"];
N3[label="local mut _x"];
N4[label="stmt let mut _x = 11i;"];
N4[label="stmt let mut _x = 11is;"];
N5[label="(dummy_node)"];
N6[label="expr loop { _x -= 1i; }"];
N7[label="expr 1i"];
N6[label="expr loop { _x -= 1is; }"];
N7[label="expr 1is"];
N8[label="expr _x"];
N9[label="expr _x -= 1i"];
N10[label="stmt _x -= 1i;"];
N11[label="block { _x -= 1i; }"];
N12[label="stmt loop { _x -= 1i; }"];
N9[label="expr _x -= 1is"];
N10[label="stmt _x -= 1is;"];
N11[label="block { _x -= 1is; }"];
N12[label="stmt loop { _x -= 1is; }"];
N13[label="expr \"unreachable\""];
N14[label="stmt \"unreachable\";"];
N15[label="block { let mut _x = 11i; loop { _x -= 1i; } \"unreachable\"; }"];
N15[label="block { let mut _x = 11is; loop { _x -= 1is; } \"unreachable\"; }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,27 +1,27 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 12i"];
N2[label="expr 12is"];
N3[label="local mut x"];
N4[label="stmt let mut x = 12i;"];
N4[label="stmt let mut x = 12is;"];
N5[label="(dummy_node)"];
N6[label="expr loop { x -= 1i; if x == 2i { break ; \"unreachable\"; } }"];
N7[label="expr 1i"];
N6[label="expr loop { x -= 1is; if x == 2is { break ; \"unreachable\"; } }"];
N7[label="expr 1is"];
N8[label="expr x"];
N9[label="expr x -= 1i"];
N10[label="stmt x -= 1i;"];
N9[label="expr x -= 1is"];
N10[label="stmt x -= 1is;"];
N11[label="expr x"];
N12[label="expr 2i"];
N13[label="expr x == 2i"];
N12[label="expr 2is"];
N13[label="expr x == 2is"];
N14[label="expr break"];
N15[label="(dummy_node)"];
N16[label="stmt break ;"];
N17[label="expr \"unreachable\""];
N18[label="stmt \"unreachable\";"];
N19[label="block { break ; \"unreachable\"; }"];
N20[label="expr if x == 2i { break ; \"unreachable\"; }"];
N21[label="block { x -= 1i; if x == 2i { break ; \"unreachable\"; } }"];
N22[label="block { let mut x = 12i; loop { x -= 1i; if x == 2i { break ; \"unreachable\"; } } }"];
N20[label="expr if x == 2is { break ; \"unreachable\"; }"];
N21[label="block { x -= 1is; if x == 2is { break ; \"unreachable\"; } }"];
N22[label="block {\l let mut x = 12is;\l loop { x -= 1is; if x == 2is { break ; \"unreachable\"; } }\l}\l"];
N0 -> N2;
N2 -> N3;
N3 -> N4;
@ -34,7 +34,7 @@ digraph block {
N11 -> N12;
N12 -> N13;
N13 -> N14;
N14 -> N6[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if x == 2i { break ; \"unreachable\"; },\lexiting scope_4 block { x -= 1i; if x == 2i { break ; \"unreachable\"; } }"];
N14 -> N6[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if x == 2is { break ; \"unreachable\"; },\lexiting scope_4 block { x -= 1is; if x == 2is { break ; \"unreachable\"; } }"];
N15 -> N16;
N16 -> N17;
N17 -> N18;

View File

@ -1,20 +1,20 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 14i"];
N2[label="expr 14is"];
N3[label="local x"];
N4[label="stmt let x = 14i;"];
N4[label="stmt let x = 14is;"];
N5[label="expr x"];
N6[label="expr 1i"];
N7[label="expr x > 1i"];
N6[label="expr 1is"];
N7[label="expr x > 1is"];
N8[label="expr return"];
N9[label="(dummy_node)"];
N10[label="stmt return;"];
N11[label="expr \"unreachable\""];
N12[label="stmt \"unreachable\";"];
N13[label="block { return; \"unreachable\"; }"];
N14[label="expr if x > 1i { return; \"unreachable\"; }"];
N15[label="block { let x = 14i; if x > 1i { return; \"unreachable\"; } }"];
N14[label="expr if x > 1is { return; \"unreachable\"; }"];
N15[label="block { let x = 14is; if x > 1is { return; \"unreachable\"; } }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,54 +1,54 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 15i"];
N2[label="expr 15is"];
N3[label="local mut x"];
N4[label="stmt let mut x = 15i;"];
N5[label="expr 151i"];
N4[label="stmt let mut x = 15is;"];
N5[label="expr 151is"];
N6[label="local mut y"];
N7[label="stmt let mut y = 151i;"];
N7[label="stmt let mut y = 151is;"];
N8[label="(dummy_node)"];
N9[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l }\l y -= 4i;\l x -= 5i;\l }\l"];
N9[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l }\l y -= 4is;\l x -= 5is;\l }\l"];
N10[label="(dummy_node)"];
N11[label="expr \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l }\l"];
N11[label="expr \'inner:\l loop {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l }\l"];
N12[label="expr x"];
N13[label="expr 1i"];
N14[label="expr x == 1i"];
N13[label="expr 1is"];
N14[label="expr x == 1is"];
N15[label="expr break \'outer"];
N16[label="(dummy_node)"];
N17[label="stmt break \'outer ;"];
N18[label="expr \"unreachable\""];
N19[label="stmt \"unreachable\";"];
N20[label="block { break \'outer ; \"unreachable\"; }"];
N21[label="expr if x == 1i { break \'outer ; \"unreachable\"; }"];
N22[label="stmt if x == 1i { break \'outer ; \"unreachable\"; }"];
N21[label="expr if x == 1is { break \'outer ; \"unreachable\"; }"];
N22[label="stmt if x == 1is { break \'outer ; \"unreachable\"; }"];
N23[label="expr y"];
N24[label="expr 2i"];
N25[label="expr y >= 2i"];
N24[label="expr 2is"];
N25[label="expr y >= 2is"];
N26[label="expr break"];
N27[label="(dummy_node)"];
N28[label="stmt break ;"];
N29[label="expr \"unreachable\""];
N30[label="stmt \"unreachable\";"];
N31[label="block { break ; \"unreachable\"; }"];
N32[label="expr if y >= 2i { break ; \"unreachable\"; }"];
N33[label="stmt if y >= 2i { break ; \"unreachable\"; }"];
N34[label="expr 3i"];
N32[label="expr if y >= 2is { break ; \"unreachable\"; }"];
N33[label="stmt if y >= 2is { break ; \"unreachable\"; }"];
N34[label="expr 3is"];
N35[label="expr y"];
N36[label="expr y -= 3i"];
N37[label="stmt y -= 3i;"];
N38[label="block {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l}\l"];
N39[label="stmt \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l }\l"];
N40[label="expr 4i"];
N36[label="expr y -= 3is"];
N37[label="stmt y -= 3is;"];
N38[label="block {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l}\l"];
N39[label="stmt \'inner:\l loop {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l }\l"];
N40[label="expr 4is"];
N41[label="expr y"];
N42[label="expr y -= 4i"];
N43[label="stmt y -= 4i;"];
N44[label="expr 5i"];
N42[label="expr y -= 4is"];
N43[label="stmt y -= 4is;"];
N44[label="expr 5is"];
N45[label="expr x"];
N46[label="expr x -= 5i"];
N47[label="stmt x -= 5i;"];
N48[label="block {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l }\l y -= 4i;\l x -= 5i;\l}\l"];
N49[label="block {\l let mut x = 15i;\l let mut y = 151i;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l }\l y -= 4i;\l x -= 5i;\l }\l}\l"];
N46[label="expr x -= 5is"];
N47[label="stmt x -= 5is;"];
N48[label="block {\l \'inner:\l loop {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l }\l y -= 4is;\l x -= 5is;\l}\l"];
N49[label="block {\l let mut x = 15is;\l let mut y = 151is;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l }\l y -= 4is;\l x -= 5is;\l }\l}\l"];
N0 -> N2;
N2 -> N3;
N3 -> N4;
@ -61,7 +61,7 @@ digraph block {
N12 -> N13;
N13 -> N14;
N14 -> N15;
N15 -> N9[label="exiting scope_0 expr break \'outer,\lexiting scope_1 stmt break \'outer ;,\lexiting scope_2 block { break \'outer ; \"unreachable\"; },\lexiting scope_3 expr if x == 1i { break \'outer ; \"unreachable\"; },\lexiting scope_4 stmt if x == 1i { break \'outer ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l }\l y -= 4i;\l x -= 5i;\l}\l"];
N15 -> N9[label="exiting scope_0 expr break \'outer,\lexiting scope_1 stmt break \'outer ;,\lexiting scope_2 block { break \'outer ; \"unreachable\"; },\lexiting scope_3 expr if x == 1is { break \'outer ; \"unreachable\"; },\lexiting scope_4 stmt if x == 1is { break \'outer ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l }\l y -= 4is;\l x -= 5is;\l}\l"];
N16 -> N17;
N17 -> N18;
N18 -> N19;
@ -73,7 +73,7 @@ digraph block {
N23 -> N24;
N24 -> N25;
N25 -> N26;
N26 -> N11[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if y >= 2i { break ; \"unreachable\"; },\lexiting scope_4 stmt if y >= 2i { break ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { break ; \"unreachable\"; }\l y -= 3i;\l}\l"];
N26 -> N11[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if y >= 2is { break ; \"unreachable\"; },\lexiting scope_4 stmt if y >= 2is { break ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1is { break \'outer ; \"unreachable\"; }\l if y >= 2is { break ; \"unreachable\"; }\l y -= 3is;\l}\l"];
N27 -> N28;
N28 -> N29;
N29 -> N30;

View File

@ -1,57 +1,57 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 16i"];
N2[label="expr 16is"];
N3[label="local mut x"];
N4[label="stmt let mut x = 16i;"];
N5[label="expr 16i"];
N4[label="stmt let mut x = 16is;"];
N5[label="expr 16is"];
N6[label="local mut y"];
N7[label="stmt let mut y = 16i;"];
N7[label="stmt let mut y = 16is;"];
N8[label="(dummy_node)"];
N9[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l }\l y -= 1i;\l x -= 1i;\l }\l"];
N9[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l }\l y -= 1is;\l x -= 1is;\l }\l"];
N10[label="(dummy_node)"];
N11[label="expr \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l }\l"];
N11[label="expr \'inner:\l loop {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l }\l"];
N12[label="expr x"];
N13[label="expr 1i"];
N14[label="expr x == 1i"];
N13[label="expr 1is"];
N14[label="expr x == 1is"];
N15[label="expr continue \'outer"];
N16[label="(dummy_node)"];
N17[label="stmt continue \'outer ;"];
N18[label="expr \"unreachable\""];
N19[label="stmt \"unreachable\";"];
N20[label="block { continue \'outer ; \"unreachable\"; }"];
N21[label="expr if x == 1i { continue \'outer ; \"unreachable\"; }"];
N22[label="stmt if x == 1i { continue \'outer ; \"unreachable\"; }"];
N21[label="expr if x == 1is { continue \'outer ; \"unreachable\"; }"];
N22[label="stmt if x == 1is { continue \'outer ; \"unreachable\"; }"];
N23[label="expr y"];
N24[label="expr 1i"];
N25[label="expr y >= 1i"];
N24[label="expr 1is"];
N25[label="expr y >= 1is"];
N26[label="expr break"];
N27[label="(dummy_node)"];
N28[label="stmt break ;"];
N29[label="expr \"unreachable\""];
N30[label="stmt \"unreachable\";"];
N31[label="block { break ; \"unreachable\"; }"];
N32[label="expr if y >= 1i { break ; \"unreachable\"; }"];
N33[label="stmt if y >= 1i { break ; \"unreachable\"; }"];
N34[label="expr 1i"];
N32[label="expr if y >= 1is { break ; \"unreachable\"; }"];
N33[label="stmt if y >= 1is { break ; \"unreachable\"; }"];
N34[label="expr 1is"];
N35[label="expr y"];
N36[label="expr y -= 1i"];
N37[label="stmt y -= 1i;"];
N38[label="block {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l}\l"];
N39[label="stmt \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l }\l"];
N40[label="expr 1i"];
N36[label="expr y -= 1is"];
N37[label="stmt y -= 1is;"];
N38[label="block {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l}\l"];
N39[label="stmt \'inner:\l loop {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l }\l"];
N40[label="expr 1is"];
N41[label="expr y"];
N42[label="expr y -= 1i"];
N43[label="stmt y -= 1i;"];
N44[label="expr 1i"];
N42[label="expr y -= 1is"];
N43[label="stmt y -= 1is;"];
N44[label="expr 1is"];
N45[label="expr x"];
N46[label="expr x -= 1i"];
N47[label="stmt x -= 1i;"];
N48[label="block {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l }\l y -= 1i;\l x -= 1i;\l}\l"];
N49[label="stmt \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l }\l y -= 1i;\l x -= 1i;\l }\l"];
N46[label="expr x -= 1is"];
N47[label="stmt x -= 1is;"];
N48[label="block {\l \'inner:\l loop {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l }\l y -= 1is;\l x -= 1is;\l}\l"];
N49[label="stmt \'outer:\l loop {\l \'inner:\l loop {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l }\l y -= 1is;\l x -= 1is;\l }\l"];
N50[label="expr \"unreachable\""];
N51[label="stmt \"unreachable\";"];
N52[label="block {\l let mut x = 16i;\l let mut y = 16i;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l }\l y -= 1i;\l x -= 1i;\l }\l \"unreachable\";\l}\l"];
N52[label="block {\l let mut x = 16is;\l let mut y = 16is;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l }\l y -= 1is;\l x -= 1is;\l }\l \"unreachable\";\l}\l"];
N0 -> N2;
N2 -> N3;
N3 -> N4;
@ -64,7 +64,7 @@ digraph block {
N12 -> N13;
N13 -> N14;
N14 -> N15;
N15 -> N8[label="exiting scope_0 expr continue \'outer,\lexiting scope_1 stmt continue \'outer ;,\lexiting scope_2 block { continue \'outer ; \"unreachable\"; },\lexiting scope_3 expr if x == 1i { continue \'outer ; \"unreachable\"; },\lexiting scope_4 stmt if x == 1i { continue \'outer ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l }\l y -= 1i;\l x -= 1i;\l}\l"];
N15 -> N8[label="exiting scope_0 expr continue \'outer,\lexiting scope_1 stmt continue \'outer ;,\lexiting scope_2 block { continue \'outer ; \"unreachable\"; },\lexiting scope_3 expr if x == 1is { continue \'outer ; \"unreachable\"; },\lexiting scope_4 stmt if x == 1is { continue \'outer ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l }\l y -= 1is;\l x -= 1is;\l}\l"];
N16 -> N17;
N17 -> N18;
N18 -> N19;
@ -76,7 +76,7 @@ digraph block {
N23 -> N24;
N24 -> N25;
N25 -> N26;
N26 -> N11[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if y >= 1i { break ; \"unreachable\"; },\lexiting scope_4 stmt if y >= 1i { break ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 1i { break ; \"unreachable\"; }\l y -= 1i;\l}\l"];
N26 -> N11[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if y >= 1is { break ; \"unreachable\"; },\lexiting scope_4 stmt if y >= 1is { break ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1is { continue \'outer ; \"unreachable\"; }\l if y >= 1is { break ; \"unreachable\"; }\l y -= 1is;\l}\l"];
N27 -> N28;
N28 -> N29;
N29 -> N30;

View File

@ -1,13 +1,13 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 1i"];
N3[label="expr 7i"];
N4[label="expr 17i"];
N5[label="expr [1i, 7i, 17i]"];
N2[label="expr 1is"];
N3[label="expr 7is"];
N4[label="expr 17is"];
N5[label="expr [1is, 7is, 17is]"];
N6[label="local _v"];
N7[label="stmt let _v = [1i, 7i, 17i];"];
N8[label="block { let _v = [1i, 7i, 17i]; }"];
N7[label="stmt let _v = [1is, 7is, 17is];"];
N8[label="block { let _v = [1is, 7is, 17is]; }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

View File

@ -1,17 +1,17 @@
digraph block {
N0[label="entry"];
N1[label="exit"];
N2[label="expr 2u"];
N3[label="expr 0u"];
N4[label="expr 20u"];
N5[label="expr [2u, 0u, 20u]"];
N2[label="expr 2us"];
N3[label="expr 0us"];
N4[label="expr 20us"];
N5[label="expr [2us, 0us, 20us]"];
N6[label="local v"];
N7[label="stmt let v = [2u, 0u, 20u];"];
N7[label="stmt let v = [2us, 0us, 20us];"];
N8[label="expr v"];
N9[label="expr 20u"];
N10[label="expr v[20u]"];
N11[label="stmt v[20u];"];
N12[label="block { let v = [2u, 0u, 20u]; v[20u]; }"];
N9[label="expr 20us"];
N10[label="expr v[20us]"];
N11[label="stmt v[20us];"];
N12[label="block { let v = [2us, 0us, 20us]; v[20us]; }"];
N0 -> N2;
N2 -> N3;
N3 -> N4;

Some files were not shown because too many files have changed in this diff Show More