Remove all i suffixes
This commit is contained in:
parent
52c74e63da
commit
7f64fe4e27
474 changed files with 1999 additions and 1999 deletions
|
|
@ -21,6 +21,6 @@ mod inner {
|
|||
}
|
||||
|
||||
pub fn foo() {
|
||||
let a = &1i as &inner::Trait;
|
||||
let a = &1 as &inner::Trait;
|
||||
a.f();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@ pub fn leaf<V>(value: V) -> TreeItem<V> {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
BTree::<int> { node: leaf(1i) };
|
||||
BTree::<int> { node: leaf(1) };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@ mod other {
|
|||
}
|
||||
|
||||
pub fn foo(){
|
||||
1i+1;
|
||||
1+1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ use syntax::ptr::P;
|
|||
use rustc::plugin::Registry;
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! exported_macro { () => (2i) }
|
||||
macro_rules! exported_macro { () => (2) }
|
||||
|
||||
macro_rules! unexported_macro { () => (3i) }
|
||||
macro_rules! unexported_macro { () => (3) }
|
||||
|
||||
#[plugin_registrar]
|
||||
pub fn plugin_registrar(reg: &mut Registry) {
|
||||
|
|
@ -47,7 +47,7 @@ fn expand_make_a_1(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
|
|||
if !tts.is_empty() {
|
||||
cx.span_fatal(sp, "make_a_1 takes no arguments");
|
||||
}
|
||||
MacExpr::new(quote_expr!(cx, 1i))
|
||||
MacExpr::new(quote_expr!(cx, 1))
|
||||
}
|
||||
|
||||
// See Issue #15750
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ fn maybe_run_test<F>(argv: &[String], name: String, test: F) where F: FnOnce() {
|
|||
}
|
||||
|
||||
fn shift_push() {
|
||||
let mut v1 = repeat(1i).take(30000).collect::<Vec<_>>();
|
||||
let mut v1 = repeat(1).take(30000).collect::<Vec<_>>();
|
||||
let mut v2 = Vec::new();
|
||||
|
||||
while v1.len() > 0 {
|
||||
|
|
|
|||
|
|
@ -150,16 +150,16 @@ fn mask(dy: int, dx: int, id: uint, p: &Vec<(int, int)>) -> Option<u64> {
|
|||
// (i/5, i%5).
|
||||
fn make_masks() -> Vec<Vec<Vec<u64> > > {
|
||||
let pieces = vec!(
|
||||
vec!((0i,0i),(0,1),(0,2),(0,3),(1,3)),
|
||||
vec!((0i,0i),(0,2),(0,3),(1,0),(1,1)),
|
||||
vec!((0i,0i),(0,1),(0,2),(1,2),(2,1)),
|
||||
vec!((0i,0i),(0,1),(0,2),(1,1),(2,1)),
|
||||
vec!((0i,0i),(0,2),(1,0),(1,1),(2,1)),
|
||||
vec!((0i,0i),(0,1),(0,2),(1,1),(1,2)),
|
||||
vec!((0i,0i),(0,1),(1,1),(1,2),(2,1)),
|
||||
vec!((0i,0i),(0,1),(0,2),(1,0),(1,2)),
|
||||
vec!((0i,0i),(0,1),(0,2),(1,2),(1,3)),
|
||||
vec!((0i,0i),(0,1),(0,2),(0,3),(1,2)));
|
||||
vec!((0,0),(0,1),(0,2),(0,3),(1,3)),
|
||||
vec!((0,0),(0,2),(0,3),(1,0),(1,1)),
|
||||
vec!((0,0),(0,1),(0,2),(1,2),(2,1)),
|
||||
vec!((0,0),(0,1),(0,2),(1,1),(2,1)),
|
||||
vec!((0,0),(0,2),(1,0),(1,1),(2,1)),
|
||||
vec!((0,0),(0,1),(0,2),(1,1),(1,2)),
|
||||
vec!((0,0),(0,1),(1,1),(1,2),(2,1)),
|
||||
vec!((0,0),(0,1),(0,2),(1,0),(1,2)),
|
||||
vec!((0,0),(0,1),(0,2),(1,2),(1,3)),
|
||||
vec!((0,0),(0,1),(0,2),(0,3),(1,2)));
|
||||
|
||||
// To break the central symmetry of the problem, every
|
||||
// transformation must be taken except for one piece (piece 3
|
||||
|
|
@ -169,7 +169,7 @@ fn make_masks() -> Vec<Vec<Vec<u64> > > {
|
|||
.map(|(id, p)| transform(p, id != 3))
|
||||
.collect();
|
||||
|
||||
(0i..50).map(|yx| {
|
||||
(0..50).map(|yx| {
|
||||
transforms.iter().enumerate().map(|(id, t)| {
|
||||
t.iter().filter_map(|p| mask(yx / 5, yx % 5, id, p)).collect()
|
||||
}).collect()
|
||||
|
|
|
|||
|
|
@ -66,9 +66,9 @@ fn parse_opts(argv: Vec<String> ) -> Config {
|
|||
}
|
||||
|
||||
fn stress_task(id: int) {
|
||||
let mut i = 0i;
|
||||
let mut i = 0;
|
||||
loop {
|
||||
let n = 15i;
|
||||
let n = 15;
|
||||
assert_eq!(fib(n), fib(n));
|
||||
i += 1;
|
||||
println!("{}: Completed {} iterations", id, i);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ fn main() {
|
|||
let f32: f32 = 2.5;
|
||||
let f64: f64 = 3.5;
|
||||
_zzz(); // #break
|
||||
if 1i == 1 { _yyy(); }
|
||||
if 1 == 1 { _yyy(); }
|
||||
}
|
||||
|
||||
fn _zzz() {()}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
fn main() {
|
||||
let a = box 1i;
|
||||
let b = box() (2i, 3.5f64);
|
||||
let a = box 1;
|
||||
let b = box() (2, 3.5f64);
|
||||
|
||||
zzz(); // #break
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ fn some_generic_fun<T1, T2>(a: T1, b: T2) -> (T2, T1) {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
some_generic_fun(0.5f64, 10i);
|
||||
some_generic_fun(&29i, box 110i);
|
||||
some_generic_fun(0.5f64, 10);
|
||||
some_generic_fun(&29, box 110);
|
||||
}
|
||||
|
||||
fn zzz() { () }
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ fn main() {
|
|||
zzz(); // #break
|
||||
}
|
||||
|
||||
for i in 1234..1235i {
|
||||
for i in 1234..1235 {
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ fn main() {
|
|||
let Struct { a: k, b: l } = Struct { a: 12, b: 13 };
|
||||
|
||||
// ignored tuple element
|
||||
let (m, _, n) = (14i, 15i, 16i);
|
||||
let (m, _, n) = (14, 15, 16);
|
||||
|
||||
// ignored struct field
|
||||
let Struct { b: o, .. } = Struct { a: 17, b: 18 };
|
||||
|
|
@ -291,25 +291,25 @@ fn main() {
|
|||
|
||||
// complex nesting
|
||||
let ((u, v), ((w, (x, Struct { a: y, b: z})), Struct { a: ae, b: oe }), ue) =
|
||||
((25i, 26i), ((27i, (28i, Struct { a: 29, b: 30})), Struct { a: 31, b: 32 }), 33i);
|
||||
((25, 26), ((27, (28, Struct { a: 29, b: 30})), Struct { a: 31, b: 32 }), 33);
|
||||
|
||||
// reference
|
||||
let &aa = &(34i, 35i);
|
||||
let &aa = &(34, 35);
|
||||
|
||||
// reference
|
||||
let &bb = &(36i, 37i);
|
||||
let &bb = &(36, 37);
|
||||
|
||||
// contained reference
|
||||
let (&cc, _) = (&38i, 39i);
|
||||
let (&cc, _) = (&38, 39);
|
||||
|
||||
// unique pointer
|
||||
let box dd = box() (40i, 41i, 42i);
|
||||
let box dd = box() (40, 41, 42);
|
||||
|
||||
// ref binding
|
||||
let ref ee = (43i, 44i, 45i);
|
||||
let ref ee = (43, 44, 45);
|
||||
|
||||
// ref binding in tuple
|
||||
let (ref ff, gg) = (46i, (47i, 48i));
|
||||
let (ref ff, gg) = (46, (47, 48));
|
||||
|
||||
// ref binding in struct
|
||||
let Struct { b: ref hh, .. } = Struct { a: 49, b: 50 };
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ fn non_immediate_args(a: BigStruct, b: BigStruct) {
|
|||
}
|
||||
|
||||
fn binding(a: i64, b: u64, c: f64) {
|
||||
let x = 0i; // #break
|
||||
let x = 0; // #break
|
||||
::std::old_io::print("")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ fn non_immediate_args(a: BigStruct, b: BigStruct) {
|
|||
|
||||
#[no_stack_check]
|
||||
fn binding(a: i64, b: u64, c: f64) {
|
||||
let x = 0i;
|
||||
let x = 0;
|
||||
::std::old_io::print("");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ fn non_immediate_args(a: BigStruct, b: BigStruct) {
|
|||
}
|
||||
|
||||
fn binding(a: i64, b: u64, c: f64) {
|
||||
let x = 0i;
|
||||
let x = 0;
|
||||
}
|
||||
|
||||
fn assignment(mut a: u64, b: u64, c: f64) {
|
||||
|
|
|
|||
|
|
@ -86,9 +86,9 @@ fn dup_tup<T0: Clone, T1: Clone>(t0: &T0, t1: &T1) -> ((T0, T1), (T1, T0)) {
|
|||
|
||||
fn main() {
|
||||
|
||||
let _ = dup_tup(&1i, &2.5f64);
|
||||
let _ = dup_tup(&1, &2.5f64);
|
||||
let _ = dup_tup(&3.5f64, &4_u16);
|
||||
let _ = dup_tup(&5i, &Struct { a: 6, b: 7.5 });
|
||||
let _ = dup_tup(&5, &Struct { a: 6, b: 7.5 });
|
||||
}
|
||||
|
||||
fn zzz() {()}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
fn outer<TA: Clone>(a: TA) {
|
||||
inner(a.clone(), 1i);
|
||||
inner(a.clone(), 1);
|
||||
inner(a.clone(), 2.5f64);
|
||||
|
||||
fn inner<TX, TY>(x: TX, y: TY) {
|
||||
|
|
@ -83,7 +83,7 @@ fn outer<TA: Clone>(a: TA) {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
outer(-1i);
|
||||
outer(-1);
|
||||
outer(-2.5f64);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ impl Enum {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
Struct::static_method(1i, 2i);
|
||||
Enum::static_method(-3i, 4.5f64, 5i);
|
||||
Struct::static_method(1, 2);
|
||||
Enum::static_method(-3, 4.5f64, 5);
|
||||
}
|
||||
|
||||
fn zzz() {()}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ fn main() {
|
|||
// 0b01011001 = 89
|
||||
let case3: Regular<u16, i32, u64> = Case3 { a: 0, b: 6438275382588823897 };
|
||||
|
||||
let univariant = TheOnlyCase { a: -1i };
|
||||
let univariant = TheOnlyCase { a: -1 };
|
||||
|
||||
zzz(); // #break
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,12 +51,12 @@ struct AGenericStruct<TKey, TValue> {
|
|||
|
||||
fn main() {
|
||||
|
||||
let int_int = AGenericStruct { key: 0i, value: 1i };
|
||||
let int_float = AGenericStruct { key: 2i, value: 3.5f64 };
|
||||
let float_int = AGenericStruct { key: 4.5f64, value: 5i };
|
||||
let int_int = AGenericStruct { key: 0, value: 1 };
|
||||
let int_float = AGenericStruct { key: 2, value: 3.5f64 };
|
||||
let float_int = AGenericStruct { key: 4.5f64, value: 5 };
|
||||
let float_int_float = AGenericStruct {
|
||||
key: 6.5f64,
|
||||
value: AGenericStruct { key: 7i, value: 8.5f64 },
|
||||
value: AGenericStruct { key: 7, value: 8.5f64 },
|
||||
};
|
||||
|
||||
zzz(); // #break
|
||||
|
|
|
|||
|
|
@ -90,15 +90,15 @@
|
|||
|
||||
fn main() {
|
||||
|
||||
let range = [1i, 2, 3];
|
||||
let range = [1, 2, 3];
|
||||
|
||||
let x = 1000000i; // wan meeeljen doollaars!
|
||||
let x = 1000000; // wan meeeljen doollaars!
|
||||
|
||||
for &x in range.iter() {
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = -1i * x;
|
||||
let x = -1 * x;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
|
|||
|
|
@ -138,8 +138,8 @@
|
|||
|
||||
fn main() {
|
||||
|
||||
let x = 999i;
|
||||
let y = -1i;
|
||||
let x = 999;
|
||||
let y = -1;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
@ -148,13 +148,13 @@ fn main() {
|
|||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 1001i;
|
||||
let x = 1001;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 1002i;
|
||||
let y = 1003i;
|
||||
let x = 1002;
|
||||
let y = 1003;
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
} else {
|
||||
|
|
@ -170,8 +170,8 @@ fn main() {
|
|||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 1004i;
|
||||
let y = 1005i;
|
||||
let x = 1004;
|
||||
let y = 1005;
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,13 +135,13 @@ struct Struct {
|
|||
|
||||
fn main() {
|
||||
|
||||
let shadowed = 231i;
|
||||
let not_shadowed = 232i;
|
||||
let shadowed = 231;
|
||||
let not_shadowed = 232;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
match (233i, 234i) {
|
||||
match (233, 234) {
|
||||
(shadowed, local_to_arm) => {
|
||||
|
||||
zzz(); // #break
|
||||
|
|
@ -149,7 +149,7 @@ fn main() {
|
|||
}
|
||||
}
|
||||
|
||||
match (235i, 236i) {
|
||||
match (235, 236) {
|
||||
// with literal
|
||||
(235, shadowed) => {
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ fn main() {
|
|||
_ => {}
|
||||
}
|
||||
|
||||
match (243i, 244i) {
|
||||
match (243, 244) {
|
||||
(shadowed, ref local_to_arm) => {
|
||||
|
||||
zzz(); // #break
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@
|
|||
// Nothing to do here really, just make sure it compiles. See issue #8513.
|
||||
fn main() {
|
||||
let _ = |&:|();
|
||||
let _ = (1u..3).map(|_| 5i);
|
||||
let _ = (1u..3).map(|_| 5);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@
|
|||
|
||||
fn main() {
|
||||
|
||||
let mut x = 0i;
|
||||
let mut x = 0;
|
||||
|
||||
loop {
|
||||
if x >= 2 {
|
||||
|
|
@ -160,7 +160,7 @@ fn main() {
|
|||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = -987i;
|
||||
let x = -987;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@
|
|||
|
||||
fn main() {
|
||||
|
||||
let mut x = 0i;
|
||||
let mut x = 0;
|
||||
|
||||
while x < 2 {
|
||||
zzz(); // #break
|
||||
|
|
@ -156,7 +156,7 @@ fn main() {
|
|||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = -987i;
|
||||
let x = -987;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ macro_rules! no_new_scope {
|
|||
|
||||
macro_rules! new_scope {
|
||||
() => ({
|
||||
let a = 890242i;
|
||||
let a = 890242;
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
})
|
||||
|
|
@ -151,8 +151,8 @@ macro_rules! dup_expr {
|
|||
|
||||
fn main() {
|
||||
|
||||
let a = trivial!(10i);
|
||||
let b = no_new_scope!(33i);
|
||||
let a = trivial!(10);
|
||||
let b = no_new_scope!(33);
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
@ -162,12 +162,12 @@ fn main() {
|
|||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
shadow_within_macro!(100i);
|
||||
shadow_within_macro!(100);
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let c = dup_expr!(10i * 20);
|
||||
let c = dup_expr!(10 * 20);
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
|
|||
|
|
@ -364,8 +364,8 @@ fn a_function(x: int) -> int {
|
|||
|
||||
fn main() {
|
||||
|
||||
let val = -1i;
|
||||
let ten = 10i;
|
||||
let val = -1;
|
||||
let ten = 10;
|
||||
|
||||
// surrounded by struct expression
|
||||
let point = Point {
|
||||
|
|
@ -417,7 +417,7 @@ fn main() {
|
|||
sentinel();
|
||||
|
||||
val
|
||||
}, 0i);
|
||||
}, 0);
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
@ -492,7 +492,7 @@ fn main() {
|
|||
sentinel();
|
||||
|
||||
// index expression
|
||||
let a_vector = [10i; 20];
|
||||
let a_vector = [10; 20];
|
||||
let _ = a_vector[{
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ fn zzz() {()}
|
|||
|
||||
fn some_function(a: int, b: int) {
|
||||
let some_variable = Struct { a: 11, b: 22 };
|
||||
let some_other_variable = 23i;
|
||||
let some_other_variable = 23;
|
||||
|
||||
for x in 0..1 {
|
||||
zzz(); // #break
|
||||
|
|
|
|||
|
|
@ -48,18 +48,18 @@
|
|||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
fn function_one() {
|
||||
let abc = 10101i;
|
||||
let abc = 10101;
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
fn function_two() {
|
||||
let abc = 20202i;
|
||||
let abc = 20202;
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
|
||||
fn function_three() {
|
||||
let abc = 30303i;
|
||||
let abc = 30303;
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,18 +48,18 @@
|
|||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
fn function_one() {
|
||||
let a = 10101i;
|
||||
let a = 10101;
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
fn function_two() {
|
||||
let b = 20202i;
|
||||
let b = 20202;
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
|
||||
fn function_three() {
|
||||
let c = 30303i;
|
||||
let c = 30303;
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,20 +103,20 @@ fn main() {
|
|||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 10i;
|
||||
let x = 10;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 10.5f64;
|
||||
let y = 20i;
|
||||
let y = 20;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
{
|
||||
let x = true;
|
||||
let y = 2220i;
|
||||
let y = 2220;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
|
|||
|
|
@ -65,13 +65,13 @@ fn a_function(x: bool, y: bool) {
|
|||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 10i;
|
||||
let x = 10;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 10.5f64;
|
||||
let y = 20i;
|
||||
let y = 20;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
|
|||
|
|
@ -67,13 +67,13 @@ fn main() {
|
|||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 10i;
|
||||
let x = 10;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 10.5f64;
|
||||
let y = 20i;
|
||||
let y = 20;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ fn main() {
|
|||
zzz(); // #break
|
||||
sentinel();
|
||||
|
||||
let x = 10i;
|
||||
let x = 10;
|
||||
|
||||
zzz(); // #break
|
||||
sentinel();
|
||||
|
|
|
|||
|
|
@ -288,15 +288,15 @@ fn main() {
|
|||
let slice2 = vec2.as_slice();
|
||||
|
||||
// Trait Objects
|
||||
let box_trait = (box 0i) as Box<Trait1>;
|
||||
let ref_trait = &0i as &Trait1;
|
||||
let mut mut_int1 = 0i;
|
||||
let box_trait = (box 0) as Box<Trait1>;
|
||||
let ref_trait = &0 as &Trait1;
|
||||
let mut mut_int1 = 0;
|
||||
let mut_ref_trait = (&mut mut_int1) as &mut Trait1;
|
||||
|
||||
let generic_box_trait = (box 0i) as Box<Trait2<i32, Mod1::Struct2>>;
|
||||
let generic_ref_trait = (&0i) as &Trait2<Struct1, Struct1>;
|
||||
let generic_box_trait = (box 0) as Box<Trait2<i32, Mod1::Struct2>>;
|
||||
let generic_ref_trait = (&0) as &Trait2<Struct1, Struct1>;
|
||||
|
||||
let mut generic_mut_ref_trait_impl = 0i;
|
||||
let mut generic_mut_ref_trait_impl = 0;
|
||||
let generic_mut_ref_trait = (&mut generic_mut_ref_trait_impl) as
|
||||
&mut Trait2<Mod1::Mod2::Struct3, GenericStruct<usize, isize>>;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
static mut VECT: [i32; 3] = [1, 2, 3];
|
||||
|
||||
fn main() {
|
||||
let a = [1i, 2, 3];
|
||||
let a = [1, 2, 3];
|
||||
|
||||
unsafe {
|
||||
VECT[0] = 4;
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
|
||||
use std::cell::Cell;
|
||||
|
||||
fn test1() { let val = &0i; { } *val; }
|
||||
fn test1() { let val = &0; { } *val; }
|
||||
|
||||
fn test2() -> int { let val = &0i; { } *val }
|
||||
fn test2() -> int { let val = &0; { } *val }
|
||||
|
||||
#[derive(Copy)]
|
||||
struct S { eax: int }
|
||||
|
|
@ -35,13 +35,13 @@ fn test5() -> (int, int) { { } (0, 1) }
|
|||
fn test6() -> bool { { } (true || false) && true }
|
||||
|
||||
fn test7() -> uint {
|
||||
let regs = &0i;
|
||||
let regs = &0;
|
||||
match true { true => { } _ => { } }
|
||||
(*regs < 2) as uint
|
||||
}
|
||||
|
||||
fn test8() -> int {
|
||||
let val = &0i;
|
||||
let val = &0;
|
||||
match true {
|
||||
true => { }
|
||||
_ => { }
|
||||
|
|
@ -54,12 +54,12 @@ fn test8() -> int {
|
|||
}
|
||||
|
||||
fn test9() {
|
||||
let regs = &Cell::new(0i);
|
||||
let regs = &Cell::new(0);
|
||||
match true { true => { } _ => { } } regs.set(regs.get() + 1);
|
||||
}
|
||||
|
||||
fn test10() -> int {
|
||||
let regs = vec!(0i);
|
||||
let regs = vec!(0);
|
||||
match true { true => { } _ => { } }
|
||||
regs[0]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn f() { if (1i == panic!()) { } else { } }
|
||||
fn f() { if (1 == panic!()) { } else { } }
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
// pp-exact
|
||||
|
||||
fn main() {
|
||||
let x = match { 5i } { 1 => 5i, 2 => 6, _ => 7, };
|
||||
let x = match { 5 } { 1 => 5, 2 => 6, _ => 7, };
|
||||
assert_eq!(x , 7);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// pp-exact
|
||||
|
||||
fn main() {
|
||||
let x = Some(3i);
|
||||
let x = Some(3);
|
||||
let _y =
|
||||
match x {
|
||||
Some(_) =>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// pp-exact
|
||||
|
||||
fn main() {
|
||||
let x = Some(3i);
|
||||
let x = Some(3);
|
||||
let _y =
|
||||
match x {
|
||||
Some(_) => "some(_)".to_string(),
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@ fn foo<'a>(x: Box<Tr+ Sync + 'a>) -> Box<Tr+ Sync + 'a> { x }
|
|||
fn main() {
|
||||
let x: Box<Tr+ Sync>;
|
||||
|
||||
Box::new(1i) as Box<Tr+ Sync>;
|
||||
Box::new(1) as Box<Tr+ Sync>;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ fn block_nosemi() -> int { ({ 0 }) - 1 }
|
|||
|
||||
fn if_semi() -> int { if true { f() } else { f() }; -1 }
|
||||
|
||||
fn if_nosemi() -> int { (if true { 0i } else { 0i }) - 1 }
|
||||
fn if_nosemi() -> int { (if true { 0 } else { 0 }) - 1 }
|
||||
|
||||
fn alt_semi() -> int { match true { true => { f() } _ => { } }; -1 }
|
||||
|
||||
fn alt_no_semi() -> int { (match true { true => { 0 } _ => { 1 } }) - 1 }
|
||||
|
||||
fn stmt() { { f() }; -1i; }
|
||||
fn stmt() { { f() }; -1; }
|
||||
|
|
|
|||
|
|
@ -15,25 +15,25 @@ fn main() {
|
|||
let _v1 =
|
||||
[
|
||||
// Comment
|
||||
0i,
|
||||
0,
|
||||
// Comment
|
||||
1i,
|
||||
1,
|
||||
// Comment
|
||||
2i];
|
||||
2];
|
||||
let _v2 =
|
||||
[0i, // Comment
|
||||
1i, // Comment
|
||||
2i]; // Comment
|
||||
[0, // Comment
|
||||
1, // Comment
|
||||
2]; // Comment
|
||||
let _v3 =
|
||||
[
|
||||
/* Comment */
|
||||
0i,
|
||||
0,
|
||||
/* Comment */
|
||||
1i,
|
||||
1,
|
||||
/* Comment */
|
||||
2i];
|
||||
2];
|
||||
let _v4 =
|
||||
[0i, /* Comment */
|
||||
1i, /* Comment */
|
||||
2i]; /* Comment */
|
||||
[0, /* Comment */
|
||||
1, /* Comment */
|
||||
2]; /* Comment */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,25 +15,25 @@ fn main() {
|
|||
let _v1 =
|
||||
[
|
||||
// Comment
|
||||
0i,
|
||||
0,
|
||||
// Comment
|
||||
1i,
|
||||
1,
|
||||
// Comment
|
||||
2i];
|
||||
2];
|
||||
let _v2 =
|
||||
[0i, // Comment
|
||||
1i, // Comment
|
||||
2i]; // Comment
|
||||
[0, // Comment
|
||||
1, // Comment
|
||||
2]; // Comment
|
||||
let _v3 =
|
||||
[
|
||||
/* Comment */
|
||||
0i,
|
||||
0,
|
||||
/* Comment */
|
||||
1i,
|
||||
1,
|
||||
/* Comment */
|
||||
2i];
|
||||
2];
|
||||
let _v4 =
|
||||
[0i, /* Comment */
|
||||
1i, /* Comment */
|
||||
2i]; /* Comment */
|
||||
[0, /* Comment */
|
||||
1, /* Comment */
|
||||
2]; /* Comment */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
// error-pattern:assertion failed: `(left == right) && (right == left)` (left: `14`, right: `15`)
|
||||
|
||||
fn main() {
|
||||
assert_eq!(14i,15i);
|
||||
assert_eq!(14,15);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
// error-pattern:panicked at 'test-assert-fmt 42 rust'
|
||||
|
||||
fn main() {
|
||||
assert!(false, "test-assert-fmt {} {}", 42i, "rust");
|
||||
assert!(false, "test-assert-fmt {} {}", 42, "rust");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ use std::uint;
|
|||
use std::mem::size_of;
|
||||
|
||||
fn main() {
|
||||
let xs = [1i, 2, 3];
|
||||
let xs = [1, 2, 3];
|
||||
xs[uint::MAX / size_of::<int>() + 1];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
// error-pattern:attempted to divide by zero
|
||||
fn main() {
|
||||
let y = 0i;
|
||||
let _z = 1i / y;
|
||||
let y = 0;
|
||||
let _z = 1 / y;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// error-pattern:index out of bounds
|
||||
|
||||
fn main() {
|
||||
let a: *const [_] = &[1i, 2, 3];
|
||||
let a: *const [_] = &[1, 2, 3];
|
||||
unsafe {
|
||||
let _b = (*a)[3];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
// error-pattern:wooooo
|
||||
fn main() {
|
||||
let mut a = 1i;
|
||||
if 1i == 1 { a = 2; }
|
||||
let mut a = 1;
|
||||
if 1 == 1 { a = 2; }
|
||||
panic!(format!("woooo{}", "o"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
// error-pattern:explicit panic
|
||||
|
||||
fn main() { let _x = if false { 0i } else if true { panic!() } else { 10i }; }
|
||||
fn main() { let _x = if false { 0 } else if true { panic!() } else { 10 }; }
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
// error-pattern:explicit panic
|
||||
|
||||
fn main() { let _x = match true { false => { 0i } true => { panic!() } }; }
|
||||
fn main() { let _x = match true { false => { 0 } true => { panic!() } }; }
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
// error-pattern:explicit panic
|
||||
|
||||
pub fn main() {
|
||||
panic!(); println!("{}", 1i);
|
||||
panic!(); println!("{}", 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
// error-pattern:so long
|
||||
fn main() {
|
||||
let mut x = Vec::new();
|
||||
let y = vec!(3i);
|
||||
let y = vec!(3);
|
||||
panic!("so long");
|
||||
x.extend(y.into_iter());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
// error-pattern:attempted remainder with a divisor of zero
|
||||
fn main() {
|
||||
let y = 0i;
|
||||
let _z = 1i % y;
|
||||
let y = 0;
|
||||
let _z = 1 % y;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn main() {
|
||||
panic!(box 413i as Box<::std::any::Any+Send>);
|
||||
panic!(box 413 as Box<::std::any::Any+Send>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
// error-pattern:panicked at 'test-fail-fmt 42 rust'
|
||||
|
||||
fn main() {
|
||||
panic!("test-fail-fmt {} {}", 42i, "rust");
|
||||
panic!("test-fail-fmt {} {}", 42, "rust");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use std::thread::Thread;
|
|||
fn main() {
|
||||
let r: Result<int,_> = Thread::scoped(move|| {
|
||||
panic!("test");
|
||||
1i
|
||||
1
|
||||
}).join();
|
||||
assert!(r.is_ok());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use std::thread::Builder;
|
|||
fn main() {
|
||||
let r: Result<int,_> = Builder::new().name("owned name".to_string()).scoped(move|| {
|
||||
panic!("test");
|
||||
1i
|
||||
1
|
||||
}).join();
|
||||
assert!(r.is_ok());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ fn a() { }
|
|||
fn b() { panic!(); }
|
||||
|
||||
fn main() {
|
||||
let _x = vec!(0i);
|
||||
let _x = vec!(0);
|
||||
a();
|
||||
let _y = vec!(0i);
|
||||
let _y = vec!(0);
|
||||
b();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ fn failfn() {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
box 0i;
|
||||
box 0;
|
||||
failfn();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ fn main() {
|
|||
let main_file = tmpdir.join("broken.rs");
|
||||
let _ = File::create(&main_file).unwrap()
|
||||
.write_str("pub fn main() {
|
||||
let \x00name_0,ctxt_0\x00 = 3i;
|
||||
let \x00name_0,ctxt_0\x00 = 3;
|
||||
println!(\"{}\", \x00name_0,ctxt_0\x00);
|
||||
}");
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ fn main() {
|
|||
Thread::scoped(move|| {
|
||||
let _a = A;
|
||||
lib::callback(|| panic!());
|
||||
1i
|
||||
1
|
||||
}).join().err().unwrap();
|
||||
|
||||
unsafe {
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ use syntax::ext::base::ExtCtxt;
|
|||
|
||||
#[allow(dead_code)]
|
||||
fn foobar(cx: &mut ExtCtxt) {
|
||||
quote_expr!(cx, 1i);
|
||||
quote_expr!(cx, 2i);
|
||||
quote_expr!(cx, 1);
|
||||
quote_expr!(cx, 2);
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@
|
|||
extern crate macro_crate_test;
|
||||
|
||||
fn main() {
|
||||
let x = 3i;
|
||||
let x = 3;
|
||||
assert_eq!(3, identity!(x));
|
||||
assert_eq!(6, identity!(x+x));
|
||||
let x = 4i;
|
||||
let x = 4;
|
||||
assert_eq!(4, identity!(x));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ extern crate syntax;
|
|||
use syntax::ext::base::ExtCtxt;
|
||||
|
||||
fn test(cx: &mut ExtCtxt) {
|
||||
let foo = 10i;
|
||||
let foo = 10;
|
||||
let _e = quote_expr!(cx, $foo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
struct Point { x : int }
|
||||
|
||||
pub fn main() {
|
||||
assert_eq!(14i,14i);
|
||||
assert_eq!(14,14);
|
||||
assert_eq!("abc".to_string(),"abc".to_string());
|
||||
assert_eq!(box Point{x:34},box Point{x:34});
|
||||
assert_eq!(&Point{x:34},&Point{x:34});
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ fn foo_uint<I: Foo<A=uint>>(x: I) -> uint {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let a = 42i;
|
||||
let a = 42;
|
||||
foo_uint(a);
|
||||
|
||||
let a = 'a';
|
||||
|
|
|
|||
|
|
@ -8,44 +8,44 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test equality constraints on associated types in a where clause.
|
||||
// Test equality constrai32s on associated types in a where clause.
|
||||
|
||||
pub trait ToInt {
|
||||
fn to_int(&self) -> int;
|
||||
pub trait ToI32 {
|
||||
fn to_i32(&self) -> i32;
|
||||
}
|
||||
|
||||
impl ToInt for int {
|
||||
fn to_int(&self) -> int { *self }
|
||||
impl ToI32 for i32 {
|
||||
fn to_i32(&self) -> i32 { *self }
|
||||
}
|
||||
|
||||
impl ToInt for uint {
|
||||
fn to_int(&self) -> int { *self as int }
|
||||
impl ToI32 for u32 {
|
||||
fn to_i32(&self) -> i32 { *self as i32 }
|
||||
}
|
||||
|
||||
pub trait GetToInt
|
||||
pub trait GetToI32
|
||||
{
|
||||
type R : ToInt;
|
||||
type R : ToI32;
|
||||
|
||||
fn get(&self) -> <Self as GetToInt>::R;
|
||||
fn get(&self) -> <Self as GetToI32>::R;
|
||||
}
|
||||
|
||||
impl GetToInt for int {
|
||||
type R = int;
|
||||
fn get(&self) -> int { *self }
|
||||
impl GetToI32 for i32 {
|
||||
type R = i32;
|
||||
fn get(&self) -> i32 { *self }
|
||||
}
|
||||
|
||||
impl GetToInt for uint {
|
||||
type R = uint;
|
||||
fn get(&self) -> uint { *self }
|
||||
impl GetToI32 for u32 {
|
||||
type R = u32;
|
||||
fn get(&self) -> u32 { *self }
|
||||
}
|
||||
|
||||
fn foo<G>(g: G) -> int
|
||||
where G : GetToInt
|
||||
fn foo<G>(g: G) -> i32
|
||||
where G : GetToI32
|
||||
{
|
||||
ToInt::to_int(&g.get())
|
||||
ToI32::to_i32(&g.get())
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
assert_eq!(foo(22i), 22i);
|
||||
assert_eq!(foo(22u), 22i);
|
||||
assert_eq!(foo(22i32), 22);
|
||||
assert_eq!(foo(22u32), 22);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,5 +22,5 @@ fn foo<B:Bar>(b: B) -> <B as Bar>::T {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
println!("{}", foo(3i));
|
||||
println!("{}", foo(3));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,6 @@ fn bar<T, I, X>(x: X) where
|
|||
}
|
||||
|
||||
fn main() {
|
||||
foo(&[0i, 1, 2]);
|
||||
bar(&[0i, 1, 2]);
|
||||
foo(&[0, 1, 2]);
|
||||
bar(&[0, 1, 2]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,6 @@ struct Thing<F: Foo> {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let thing = Thing{a: 1i, b: 2i};
|
||||
let thing = Thing{a: 1, b: 2};
|
||||
assert_eq!(thing.a + 1, thing.b);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ fn foo2<I: Foo>(x: I) -> <I as Foo>::A {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let a = 42i;
|
||||
let a = 42;
|
||||
assert!(foo2(a) == 42u);
|
||||
|
||||
let a = Bar;
|
||||
assert!(foo2(a) == 43i);
|
||||
assert!(foo2(a) == 43);
|
||||
|
||||
let a = 'a';
|
||||
foo1(a);
|
||||
|
|
|
|||
|
|
@ -40,5 +40,5 @@ impl<T: Foo> C for B<T> {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let z: uint = bar(2i, 4u);
|
||||
let z: uint = bar(2, 4u);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@ struct Triple { x: int, y: int, z: int }
|
|||
fn f<T,U>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
|
||||
|
||||
pub fn main() {
|
||||
println!("{}", f(Triple {x: 3, y: 4, z: 5}, 4i).a.x);
|
||||
println!("{}", f(5i, 6i).a);
|
||||
println!("{}", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
|
||||
println!("{}", f(5, 6).a);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
pub fn main() {
|
||||
let mut sum = 0i;
|
||||
let mut sum = 0;
|
||||
let xs = vec!(1, 2, 3, 4, 5);
|
||||
for x in xs.iter() {
|
||||
sum += *x;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ impl<T> Pushable<T> for Vec<T> {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let mut v = vec!(1i);
|
||||
let mut v = vec!(1);
|
||||
v.push_val(2);
|
||||
v.push_val(3);
|
||||
assert_eq!(v, vec!(1, 2, 3));
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use std::ops::{Drop, FnMut, FnOnce};
|
|||
|
||||
#[inline(never)]
|
||||
fn foo() {
|
||||
let _v = vec![1i, 2, 3];
|
||||
let _v = vec![1, 2, 3];
|
||||
if os::getenv("IS_TEST").is_some() {
|
||||
panic!()
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ fn runtest(me: &str) {
|
|||
assert!(!out.status.success());
|
||||
let s = str::from_utf8(out.error.as_slice()).unwrap();
|
||||
let mut i = 0;
|
||||
for _ in 0i..2 {
|
||||
for _ in 0..2 {
|
||||
i += s[i + 10..].find_str("stack backtrace").unwrap() + 10;
|
||||
}
|
||||
assert!(s[i + 10..].find_str("stack backtrace").is_none(),
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
// Check that issue #954 stays fixed
|
||||
|
||||
pub fn main() {
|
||||
match -1i { -1 => {}, _ => panic!("wat") }
|
||||
assert_eq!(1i-1, 0i);
|
||||
match -1 { -1 => {}, _ => panic!("wat") }
|
||||
assert_eq!(1-1, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,5 +22,5 @@ fn bitv_test() {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
for _ in 0i..10000 { bitv_test(); }
|
||||
for _ in 0..10000 { bitv_test(); }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ fn general() {
|
|||
assert_eq!(0xf0i | 0xf, 0xff);
|
||||
assert_eq!(0xfi << 4, 0xf0);
|
||||
assert_eq!(0xf0i >> 4, 0xf);
|
||||
assert_eq!(-16i >> 2, -4);
|
||||
assert_eq!(-16 >> 2, -4);
|
||||
assert_eq!(0b1010_1010i | 0b0101_0101, 0xff);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ pub fn main() {
|
|||
|
||||
let num = 12;
|
||||
|
||||
assert_eq!(if (true) { 12i } else { 12 } - num, 0);
|
||||
assert_eq!(12i - if (true) { 12i } else { 12 }, 0);
|
||||
if (true) { 12i; } {-num};
|
||||
if (true) { 12i; }; {-num};
|
||||
if (true) { 12i; };;; -num;
|
||||
assert_eq!(if (true) { 12 } else { 12 } - num, 0);
|
||||
assert_eq!(12 - if (true) { 12 } else { 12 }, 0);
|
||||
if (true) { 12; } {-num};
|
||||
if (true) { 12; }; {-num};
|
||||
if (true) { 12; };;; -num;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
fn iter_vec<T, F>(v: Vec<T> , mut f: F) where F: FnMut(&T) { for x in v.iter() { f(x); } }
|
||||
|
||||
pub fn main() {
|
||||
let v = vec!(1i, 2, 3, 4, 5, 6, 7);
|
||||
let mut odds = 0i;
|
||||
let v = vec![1i32, 2, 3, 4, 5, 6, 7];
|
||||
let mut odds = 0i32;
|
||||
iter_vec(v, |i| {
|
||||
if *i % 2 == 1 {
|
||||
odds += 1;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
fn iter_vec<T, F>(v: Vec<T>, mut f: F) where F: FnMut(&T) { for x in v.iter() { f(x); } }
|
||||
|
||||
pub fn main() {
|
||||
let v = vec!(1i, 2, 3, 4, 5);
|
||||
let v = vec![1i32, 2, 3, 4, 5];
|
||||
let mut sum = 0;
|
||||
iter_vec(v.clone(), |i| {
|
||||
iter_vec(v.clone(), |j| {
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
struct Foo(int, int);
|
||||
|
||||
fn main() {
|
||||
let x = (1i, 2i);
|
||||
let x = (1, 2);
|
||||
let a = &x.0;
|
||||
let b = &x.0;
|
||||
assert_eq!(*a, 1);
|
||||
assert_eq!(*b, 1);
|
||||
|
||||
let mut x = (1i, 2i);
|
||||
let mut x = (1, 2);
|
||||
{
|
||||
let a = &x.0;
|
||||
let b = &mut x.1;
|
||||
|
|
@ -28,13 +28,13 @@ fn main() {
|
|||
assert_eq!(x.1, 5);
|
||||
|
||||
|
||||
let x = Foo(1i, 2i);
|
||||
let x = Foo(1, 2);
|
||||
let a = &x.0;
|
||||
let b = &x.0;
|
||||
assert_eq!(*a, 1);
|
||||
assert_eq!(*b, 1);
|
||||
|
||||
let mut x = Foo(1i, 2i);
|
||||
let mut x = Foo(1, 2);
|
||||
{
|
||||
let a = &x.0;
|
||||
let b = &mut x.1;
|
||||
|
|
|
|||
|
|
@ -14,28 +14,28 @@
|
|||
// that the main function can read the variable too while
|
||||
// the closures are in scope. Issue #6801.
|
||||
|
||||
fn a() -> int {
|
||||
let mut x = 3i;
|
||||
fn a() -> i32 {
|
||||
let mut x = 3i32;
|
||||
x += 1;
|
||||
let c1 = |&:| x * 4;
|
||||
let c2 = |&:| x * 5;
|
||||
c1() * c2() * x
|
||||
}
|
||||
|
||||
fn get(x: &int) -> int {
|
||||
fn get(x: &i32) -> i32 {
|
||||
*x * 4
|
||||
}
|
||||
|
||||
fn b() -> int {
|
||||
let mut x = 3;
|
||||
fn b() -> i32 {
|
||||
let mut x = 3i32;
|
||||
x += 1;
|
||||
let c1 = |&:| get(&x);
|
||||
let c2 = |&:| get(&x);
|
||||
c1() * c2() * x
|
||||
}
|
||||
|
||||
fn c() -> int {
|
||||
let mut x = 3;
|
||||
fn c() -> i32 {
|
||||
let mut x = 3i32;
|
||||
x += 1;
|
||||
let c1 = |&:| x * 5;
|
||||
let c2 = |&:| get(&x);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
pub fn main() {
|
||||
let x = [22i];
|
||||
let x = [22];
|
||||
let y = &x[0];
|
||||
assert_eq!(*y, 22);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ fn get<'a, T>(ms: &'a MutSlice<'a, T>, index: uint) -> &'a T {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let mut data = [1i, 2, 3];
|
||||
let mut data = [1, 2, 3];
|
||||
{
|
||||
let slice = MutSlice { data: &mut data };
|
||||
slice.data[0] += 4;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ pub fn main() {
|
|||
None => {
|
||||
// It is ok to reassign x here, because there is in
|
||||
// fact no outstanding loan of x!
|
||||
x = Some(0i);
|
||||
x = Some(0);
|
||||
}
|
||||
Some(_) => { }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
|
||||
pub fn main() {
|
||||
let (&x, &y) = (&3i, &'a');
|
||||
let (&x, &y) = (&3, &'a');
|
||||
assert_eq!(x, 3);
|
||||
assert_eq!(y, 'a');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@ fn foo<T:Clone>(x: &T) -> T{
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
assert_eq!(foo(&3i), 3i);
|
||||
assert_eq!(foo(&3), 3);
|
||||
assert_eq!(foo(&'a'), 'a');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@
|
|||
// except according to those terms.
|
||||
|
||||
pub fn main() {
|
||||
let mut i = 0i;
|
||||
let mut i = 0;
|
||||
while i < 20 { i += 1; if i == 10 { break; } }
|
||||
assert_eq!(i, 10);
|
||||
loop { i += 1; if i == 20 { break; } }
|
||||
assert_eq!(i, 20);
|
||||
let xs = [1i, 2, 3, 4, 5, 6];
|
||||
let xs = [1, 2, 3, 4, 5, 6];
|
||||
for x in xs.iter() {
|
||||
if *x == 3 { break; } assert!((*x <= 3));
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ pub fn main() {
|
|||
i += 1; if i % 2 == 0 { continue; } assert!((i % 2 != 0));
|
||||
if i >= 10 { break; }
|
||||
}
|
||||
let ys = vec!(1i, 2, 3, 4, 5, 6);
|
||||
let ys = vec!(1, 2, 3, 4, 5, 6);
|
||||
for x in ys.iter() {
|
||||
if *x % 2 == 0 { continue; }
|
||||
assert!((*x % 2 != 0));
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ impl<T: Speak> Speak for Option<T> {
|
|||
|
||||
|
||||
pub fn main() {
|
||||
assert_eq!(3i.hi(), "hello: 3".to_string());
|
||||
assert_eq!(Some(Some(3i)).hi(),
|
||||
assert_eq!(3.hi(), "hello: 3".to_string());
|
||||
assert_eq!(Some(Some(3)).hi(),
|
||||
"something!something!hello: 3".to_string());
|
||||
assert_eq!(None::<int>.hi(), "hello - none".to_string());
|
||||
|
||||
assert_eq!(Some(None::<int>).hi(), "something!hello - none".to_string());
|
||||
assert_eq!(Some(3i).hi(), "something!hello: 3".to_string());
|
||||
assert_eq!(Some(3).hi(), "something!hello: 3".to_string());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,6 @@ fn foo<T: Foo>(val: T, chan: Sender<T>) {
|
|||
|
||||
pub fn main() {
|
||||
let (tx, rx) = channel();
|
||||
foo(31337i, tx);
|
||||
assert!(rx.recv().unwrap() == 31337i);
|
||||
foo(31337, tx);
|
||||
assert!(rx.recv().unwrap() == 31337);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,6 @@ fn foo<T: RequiresRequiresShareAndSend>(val: T, chan: Sender<T>) {
|
|||
|
||||
pub fn main() {
|
||||
let (tx, rx): (Sender<X<int>>, Receiver<X<int>>) = channel();
|
||||
foo(X(31337i), tx);
|
||||
assert!(rx.recv().unwrap() == X(31337i));
|
||||
foo(X(31337), tx);
|
||||
assert!(rx.recv().unwrap() == X(31337));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,6 @@ fn foo<T: Foo>(val: T, chan: Sender<T>) {
|
|||
|
||||
pub fn main() {
|
||||
let (tx, rx): (Sender<int>, Receiver<int>) = channel();
|
||||
foo(31337i, tx);
|
||||
assert!(rx.recv().unwrap() == 31337i);
|
||||
foo(31337, tx);
|
||||
assert!(rx.recv().unwrap() == 31337);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,6 @@ impl <T: Send> Foo for T { }
|
|||
|
||||
pub fn main() {
|
||||
let (tx, rx) = channel();
|
||||
1193182i.foo(tx);
|
||||
assert!(rx.recv().unwrap() == 1193182i);
|
||||
1193182.foo(tx);
|
||||
assert!(rx.recv().unwrap() == 1193182);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ extern crate cci_iter_lib;
|
|||
pub fn main() {
|
||||
//let bt0 = sys::rusti::frame_address(1u32);
|
||||
//println!("%?", bt0);
|
||||
cci_iter_lib::iter(&[1i, 2, 3], |i| {
|
||||
cci_iter_lib::iter(&[1, 2, 3], |i| {
|
||||
println!("{}", *i);
|
||||
//assert!(bt0 == sys::rusti::frame_address(2u32));
|
||||
})
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue