mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-28 15:43:21 +00:00
Adjust tests to be clearer about the type that results from a shift expression.
This commit is contained in:
parent
705b92bdfe
commit
a661bd6575
@ -33,6 +33,10 @@ fn foo(p: &Panolpy) {
|
||||
|
||||
22 >> 1;
|
||||
// Integer literal types are OK
|
||||
|
||||
// Type of the result follows the LHS, not the RHS:
|
||||
let _: i32 = 22_i64 >> 1_i32;
|
||||
//~^ ERROR mismatched types: expected `i32`, found `i64`
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -25,17 +25,17 @@ struct Panolpy {
|
||||
}
|
||||
|
||||
fn foo(p: &Panolpy) {
|
||||
assert_eq!(22 >> p.i8, 11_i8);
|
||||
assert_eq!(22 >> p.i16, 11_i16);
|
||||
assert_eq!(22 >> p.i32, 11_i32);
|
||||
assert_eq!(22 >> p.i64, 11_i64);
|
||||
assert_eq!(22 >> p.isize, 11_is);
|
||||
assert_eq!(22_i32 >> p.i8, 11_i32);
|
||||
assert_eq!(22_i32 >> p.i16, 11_i32);
|
||||
assert_eq!(22_i32 >> p.i32, 11_i32);
|
||||
assert_eq!(22_i32 >> p.i64, 11_i32);
|
||||
assert_eq!(22_i32 >> p.isize, 11_i32);
|
||||
|
||||
assert_eq!(22 >> p.u8, 11_u8);
|
||||
assert_eq!(22 >> p.u16, 11_u16);
|
||||
assert_eq!(22 >> p.u32, 11_u32);
|
||||
assert_eq!(22 >> p.u64, 11_u64);
|
||||
assert_eq!(22 >> p.usize, 11_us);
|
||||
assert_eq!(22_i32 >> p.u8, 11_i32);
|
||||
assert_eq!(22_i32 >> p.u16, 11_i32);
|
||||
assert_eq!(22_i32 >> p.u32, 11_i32);
|
||||
assert_eq!(22_i32 >> p.u64, 11_i32);
|
||||
assert_eq!(22_i32 >> p.usize, 11_i32);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user