Skip to content

Commit 3ee2246

Browse files
authored
Unrolled build for rust-lang#139889
Rollup merge of rust-lang#139889 - spencer3035:clean-ui-tests-3-of-n, r=jieyouxu Clean UI tests 3 of n Cleaned up 2 tests in `tests/ui/numbers-arithemetic` to be more useful. One for each commit. I can squash these into one commit when approved. Related Issues: rust-lang#73494 rust-lang#133895 r? jieyouxu
2 parents 79a272c + 7ce21e4 commit 3ee2246

File tree

4 files changed

+50
-12
lines changed

4 files changed

+50
-12
lines changed

Diff for: tests/ui/numbers-arithmetic/int.rs

-6
This file was deleted.

Diff for: tests/ui/numbers-arithmetic/isize-base.rs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//! Tests basic `isize` functionality
2+
3+
//@ run-pass
4+
5+
pub fn main() {
6+
// Literal matches assignment type
7+
let a: isize = 42isize;
8+
// Literal cast
9+
let b: isize = 42 as isize;
10+
// Literal type inference from assignment type
11+
let c: isize = 42;
12+
// Assignment type inference from literal (and later comparison)
13+
let d = 42isize;
14+
// Function return value type inference
15+
let e = return_val();
16+
17+
assert_eq!(a, b);
18+
assert_eq!(a, c);
19+
assert_eq!(a, d);
20+
assert_eq!(a, e);
21+
}
22+
23+
fn return_val() -> isize {
24+
42
25+
}

Diff for: tests/ui/numbers-arithmetic/uint.rs

-6
This file was deleted.

Diff for: tests/ui/numbers-arithmetic/usize-base.rs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//! Tests basic `usize` functionality
2+
3+
//@ run-pass
4+
5+
pub fn main() {
6+
// Literal matches assignment type
7+
let a: usize = 42usize;
8+
// Literal cast
9+
let b: usize = 42 as usize;
10+
// Literal type inference from assignment type
11+
let c: usize = 42;
12+
// Assignment type inference from literal (and later comparison)
13+
let d = 42usize;
14+
// Function return value type inference
15+
let e = return_val();
16+
17+
assert_eq!(a, b);
18+
assert_eq!(a, c);
19+
assert_eq!(a, d);
20+
assert_eq!(a, e);
21+
}
22+
23+
fn return_val() -> usize {
24+
42
25+
}

0 commit comments

Comments
 (0)