Test fixes.
This commit is contained in:
parent
441044f071
commit
dc1ba08d16
@ -98,13 +98,13 @@ fn rand_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure)
|
||||
rand_name,
|
||||
vec!(rng.clone()));
|
||||
|
||||
// need to specify the uint-ness of the random number
|
||||
let uint_ty = cx.ty_ident(trait_span, cx.ident_of("uint"));
|
||||
// need to specify the usize-ness of the random number
|
||||
let usize_ty = cx.ty_ident(trait_span, cx.ident_of("usize"));
|
||||
let value_ident = cx.ident_of("__value");
|
||||
let let_statement = cx.stmt_let_typed(trait_span,
|
||||
false,
|
||||
value_ident,
|
||||
uint_ty,
|
||||
usize_ty,
|
||||
rv_call);
|
||||
|
||||
// rand() % variants.len()
|
||||
|
@ -355,7 +355,7 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
|
||||
Some("the `int` type is deprecated; \
|
||||
use `isize` or a fixed-sized integer")
|
||||
} else if name == "uint" {
|
||||
Some("the `unt` type is deprecated; \
|
||||
Some("the `uint` type is deprecated; \
|
||||
use `usize` or a fixed-sized integer")
|
||||
} else {
|
||||
None
|
||||
|
@ -11,21 +11,21 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
mod u {
|
||||
type X = usize; //~ WARN the `usize` type is deprecated
|
||||
type X = uint; //~ WARN the `uint` type is deprecated
|
||||
struct Foo {
|
||||
x: usize //~ WARN the `usize` type is deprecated
|
||||
x: uint //~ WARN the `uint` type is deprecated
|
||||
}
|
||||
fn bar(x: usize) { //~ WARN the `usize` type is deprecated
|
||||
1us; //~ WARN the `u` suffix on integers is deprecated
|
||||
fn bar(x: uint) { //~ WARN the `uint` type is deprecated
|
||||
1u; //~ WARN the `u` suffix on integers is deprecated
|
||||
}
|
||||
}
|
||||
mod i {
|
||||
type X = isize; //~ WARN the `isize` type is deprecated
|
||||
type X = int; //~ WARN the `int` type is deprecated
|
||||
struct Foo {
|
||||
x: isize //~ WARN the `isize` type is deprecated
|
||||
x: int //~ WARN the `int` type is deprecated
|
||||
}
|
||||
fn bar(x: isize) { //~ WARN the `isize` type is deprecated
|
||||
1is; //~ WARN the `u` suffix on integers is deprecated
|
||||
fn bar(x: int) { //~ WARN the `int` type is deprecated
|
||||
1i; //~ WARN the `i` suffix on integers is deprecated
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ fn main() {
|
||||
let x = [1,2];
|
||||
let y = match x {
|
||||
[] => None,
|
||||
//~^ ERROR types: expected `[_#0is; 2]`, found `[_#7t; 0]`
|
||||
//~^ ERROR types: expected `[_#0i; 2]`, found `[_#7t; 0]`
|
||||
// (expected array of 2 elements, found array of 0 elements)
|
||||
[a,_] => Some(a)
|
||||
};
|
||||
|
@ -10,5 +10,5 @@
|
||||
|
||||
fn main() {
|
||||
let _i = 18446744073709551616; // 2^64
|
||||
//~^ ERROR isize literal is too large
|
||||
//~^ ERROR int literal is too large
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ fn main() {
|
||||
0o; //~ ERROR: no valid digits
|
||||
1e+; //~ ERROR: expected at least one digit in exponent
|
||||
0x539.0; //~ ERROR: hexadecimal float literal is not supported
|
||||
99999999999999999999999999999999; //~ ERROR: isize literal is too large
|
||||
99999999999999999999999999999999u32; //~ ERROR: isize literal is too large
|
||||
99999999999999999999999999999999; //~ ERROR: int literal is too large
|
||||
99999999999999999999999999999999u32; //~ ERROR: int literal is too large
|
||||
0x; //~ ERROR: no valid digits
|
||||
0xu32; //~ ERROR: no valid digits
|
||||
0ou32; //~ ERROR: no valid digits
|
||||
|
@ -50,12 +50,12 @@ fn qux() {
|
||||
}
|
||||
|
||||
fn quy() {
|
||||
let i = -23us; //~ WARNING negation of unsigned isize literal may be unintentional
|
||||
let i = -23us; //~ WARNING negation of unsigned int literal may be unintentional
|
||||
//~^ WARNING unused variable
|
||||
}
|
||||
|
||||
fn quz() {
|
||||
let i = 23us;
|
||||
let j = -i; //~ WARNING negation of unsigned isize variable may be unintentional
|
||||
let j = -i; //~ WARNING negation of unsigned int variable may be unintentional
|
||||
//~^ WARNING unused variable
|
||||
}
|
||||
|
@ -9,5 +9,5 @@
|
||||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
println!("{}", 18446744073709551616u64); //~ error: isize literal is too large
|
||||
println!("{}", 18446744073709551616u64); //~ error: int literal is too large
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user