Skip to content

Commit e40449e

Browse files
committed
Auto merge of #24485 - brson:is, r=alexcrichton
It was an oversight that this was not done in the great int upheaval. [breaking-change]
2 parents abf0548 + 5a3a599 commit e40449e

File tree

8 files changed

+24
-12
lines changed

8 files changed

+24
-12
lines changed

src/librustc_trans/trans/tvec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ fn iter_vec_loop<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
361361
InBoundsGEP(bcx, data_ptr, &[loop_counter])
362362
};
363363
let bcx = f(bcx, lleltptr, vt.unit_ty);
364-
let plusone = Add(bcx, loop_counter, C_uint(bcx.ccx(), 1us), DebugLoc::None);
364+
let plusone = Add(bcx, loop_counter, C_uint(bcx.ccx(), 1usize), DebugLoc::None);
365365
AddIncomingToPhi(loop_counter, plusone, bcx.llbb);
366366

367367
let cond_val = ICmp(bcx, llvm::IntULT, plusone, count, DebugLoc::None);

src/libsyntax/parse/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,6 @@ pub fn integer_lit(s: &str, suffix: Option<&str>, sd: &SpanHandler, sp: Span) ->
714714
"u16" => ast::UnsignedIntLit(ast::TyU16),
715715
"u32" => ast::UnsignedIntLit(ast::TyU32),
716716
"u64" => ast::UnsignedIntLit(ast::TyU64),
717-
"is" => ast::SignedIntLit(ast::TyIs, ast::Plus),
718-
"us" => ast::UnsignedIntLit(ast::TyUs),
719717
_ => {
720718
// i<digits> and u<digits> look like widths, so lets
721719
// give an error message along those lines

src/test/auxiliary/issue-11224.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ mod inner {
2121
}
2222

2323
pub fn foo() {
24-
let a = &1is as &inner::Trait;
24+
let a = &1isize as &inner::Trait;
2525
a.f();
2626
}

src/test/compile-fail/lint-type-limits.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ fn qux() {
5252
}
5353

5454
fn quy() {
55-
let i = -23_us; //~ WARNING negation of unsigned int literal may be unintentional
55+
let i = -23_usize; //~ WARNING negation of unsigned int literal may be unintentional
5656
//~^ WARNING unused variable
5757
}
5858

5959
fn quz() {
60-
let i = 23_us;
60+
let i = 23_usize;
6161
let j = -i; //~ WARNING negation of unsigned int variable may be unintentional
6262
//~^ WARNING unused variable
6363
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
let a = 1_is; //~ ERROR illegal suffix
13+
let b = 2_us; //~ ERROR illegal suffix
14+
}

src/test/run-make/symbols-are-reasonable/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ impl Foo for usize {}
1616

1717
pub fn dummy() {
1818
// force the vtable to be created
19-
let _x = &1us as &Foo;
19+
let _x = &1usize as &Foo;
2020
}

src/test/run-pass/autoderef-method-on-trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ impl double for usize {
2121
}
2222

2323
pub fn main() {
24-
let x: Box<_> = box() (box 3us as Box<double>);
24+
let x: Box<_> = box() (box 3usize as Box<double>);
2525
assert_eq!(x.double(), 6);
2626
}

src/test/run-pass/issue-15763.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ fn main() {
8787
assert_eq!(cc().unwrap(), 3);
8888
assert_eq!(dd().unwrap(), 3);
8989

90-
let i = box 32is as Box<A>;
90+
let i = box 32isize as Box<A>;
9191
assert_eq!(i.aaa(), 3);
92-
let i = box 32is as Box<A>;
92+
let i = box 32isize as Box<A>;
9393
assert_eq!(i.bbb(), 3);
94-
let i = box 32is as Box<A>;
94+
let i = box 32isize as Box<A>;
9595
assert_eq!(i.ccc().unwrap(), 3);
96-
let i = box 32is as Box<A>;
96+
let i = box 32isize as Box<A>;
9797
assert_eq!(i.ddd().unwrap(), 3);
9898
}

0 commit comments

Comments
 (0)