Skip to content

Commit eac6fac

Browse files
Update tests
1 parent 27810e2 commit eac6fac

22 files changed

+44
-44
lines changed

src/test/ui/autoderef-full-lval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ fn main() {
1313
let a: Clam = Clam{x: box 1, y: box 2};
1414
let b: Clam = Clam{x: box 10, y: box 20};
1515
let z: isize = a.x + b.y;
16-
//~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
16+
//~^ ERROR cannot add `std::boxed::Box<isize>` to `std::boxed::Box<isize>`
1717
println!("{}", z);
1818
assert_eq!(z, 21);
1919
let forty: Fish = Fish{a: box 40};
2020
let two: Fish = Fish{a: box 2};
2121
let answer: isize = forty.a + two.a;
22-
//~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
22+
//~^ ERROR cannot add `std::boxed::Box<isize>` to `std::boxed::Box<isize>`
2323
println!("{}", answer);
2424
assert_eq!(answer, 42);
2525
}

src/test/ui/binary-op-on-double-ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fn main() {
22
let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];
33
let vr = v.iter().filter(|x| {
44
x % 2 == 0
5-
//~^ ERROR binary operation `%` cannot be applied to type `&&{integer}`
5+
//~^ ERROR cannot mod `&&{integer}` by `{integer}`
66
});
77
println!("{:?}", vr);
88
}

src/test/ui/binop/binop-bitxor-str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// error-pattern:`^` cannot be applied to type `std::string::String`
1+
// error-pattern:no implementation for `std::string::String ^ std::string::String`
22

33
fn main() { let x = "a".to_string() ^ "b".to_string(); }

src/test/ui/binop/binop-mul-bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// error-pattern:`*` cannot be applied to type `bool`
1+
// error-pattern:cannot multiply `bool` to `bool`
22

33
fn main() { let x = true * false; }

src/test/ui/binop/binop-typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ fn main() {
44
let x = true;
55
let y = 1;
66
let z = x + y;
7-
//~^ ERROR binary operation `+` cannot be applied to type `bool`
7+
//~^ ERROR cannot add `{integer}` to `bool`
88
}

src/test/ui/for/for-loop-type-error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub fn main() {
2-
let x = () + (); //~ ERROR binary operation
2+
let x = () + (); //~ ERROR cannot add `()` to `()`
33

44
// this shouldn't have a flow-on error:
55
for _ in x {}

src/test/ui/issues/issue-14915.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ fn main() {
44
let x: Box<isize> = box 0;
55

66
println!("{}", x + 1);
7-
//~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
7+
//~^ ERROR cannot add `{integer}` to `std::boxed::Box<isize>`
88
}

src/test/ui/issues/issue-24363.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() {
22
1.create_a_type_error[ //~ `{integer}` is a primitive type and therefore doesn't have fields
3-
()+() //~ ERROR binary operation `+` cannot be applied
3+
()+() //~ ERROR cannot add
44
// ^ ensure that we typeck the inner expression ^
55
];
66
}

src/test/ui/issues/issue-28837.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ struct A;
33
fn main() {
44
let a = A;
55

6-
a + a; //~ ERROR binary operation `+` cannot be applied to type `A`
6+
a + a; //~ ERROR cannot add `A` to `A`
77

8-
a - a; //~ ERROR binary operation `-` cannot be applied to type `A`
8+
a - a; //~ ERROR cannot substract `A` from `A`
99

10-
a * a; //~ ERROR binary operation `*` cannot be applied to type `A`
10+
a * a; //~ ERROR cannot multiply `A` to `A`
1111

12-
a / a; //~ ERROR binary operation `/` cannot be applied to type `A`
12+
a / a; //~ ERROR cannot divide `A` by `A`
1313

14-
a % a; //~ ERROR binary operation `%` cannot be applied to type `A`
14+
a % a; //~ ERROR cannot mod `A` by `A`
1515

16-
a & a; //~ ERROR binary operation `&` cannot be applied to type `A`
16+
a & a; //~ ERROR no implementation for `A & A`
1717

18-
a | a; //~ ERROR binary operation `|` cannot be applied to type `A`
18+
a | a; //~ ERROR no implementation for `A | A`
1919

20-
a << a; //~ ERROR binary operation `<<` cannot be applied to type `A`
20+
a << a; //~ ERROR no implementation for `A << A`
2121

22-
a >> a; //~ ERROR binary operation `>>` cannot be applied to type `A`
22+
a >> a; //~ ERROR no implementation for `A >> A`
2323

2424
a == a; //~ ERROR binary operation `==` cannot be applied to type `A`
2525

src/test/ui/issues/issue-31076.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ impl Add<i32> for i32 {}
1111

1212
fn main() {
1313
let x = 5 + 6;
14-
//~^ ERROR binary operation `+` cannot be applied to type `{integer}`
14+
//~^ ERROR cannot add `{integer}` to `{integer}`
1515
let y = 5i32 + 6i32;
16-
//~^ ERROR binary operation `+` cannot be applied to type `i32`
16+
//~^ ERROR cannot add `i32` to `i32`
1717
}

0 commit comments

Comments
 (0)