Skip to content

Commit eac6fac

Browse files
Update tests
1 parent 27810e2 commit eac6fac

22 files changed

+44
-44
lines changed

Diff for: src/test/ui/autoderef-full-lval.rs

+2-2
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
}

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

+1-1
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
}

Diff for: src/test/ui/binop/binop-bitxor-str.rs

+1-1
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(); }

Diff for: src/test/ui/binop/binop-mul-bool.rs

+1-1
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; }

Diff for: src/test/ui/binop/binop-typeck.rs

+1-1
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
}

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

+1-1
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 {}

Diff for: src/test/ui/issues/issue-14915.rs

+1-1
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
}

Diff for: src/test/ui/issues/issue-24363.rs

+1-1
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
}

Diff for: src/test/ui/issues/issue-28837.rs

+9-9
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

Diff for: src/test/ui/issues/issue-31076.rs

+2-2
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
}

Diff for: src/test/ui/issues/issue-35668.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn func<'a, T>(a: &'a [T]) -> impl Iterator<Item=&'a T> {
22
a.iter().map(|a| a*a)
3-
//~^ ERROR binary operation `*` cannot be applied to type `&T`
3+
//~^ ERROR cannot multiply `&T` to `&T`
44
}
55

66
fn main() {

Diff for: src/test/ui/issues/issue-3820.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ impl Thing {
1111
fn main() {
1212
let u = Thing {x: 2};
1313
let _v = u.mul(&3); // This is ok
14-
let w = u * 3; //~ ERROR binary operation `*` cannot be applied to type `Thing`
14+
let w = u * 3; //~ ERROR cannot multiply `{integer}` to `Thing`
1515
}

Diff for: src/test/ui/issues/issue-40610.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ fn f(_: &[f32]) {}
22

33
fn main() {
44
() + f(&[1.0]);
5-
//~^ ERROR binary operation `+` cannot be applied to type `()`
5+
//~^ ERROR cannot add `()` to `()`
66
}

Diff for: src/test/ui/issues/issue-41394.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
enum Foo {
22
A = "" + 1
3-
//~^ ERROR binary operation `+` cannot be applied to type `&str`
3+
//~^ ERROR cannot add `{integer}` to `&str`
44
}
55

66
enum Bar {

Diff for: src/test/ui/or-patterns/or-patterns-syntactic-fail.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use E::*;
2121

2222
fn no_top_level_or_patterns() {
2323
// We do *not* allow or-patterns at the top level of lambdas...
24-
let _ = |A | B: E| (); //~ ERROR binary operation `|` cannot be applied to type `E`
24+
let _ = |A | B: E| (); //~ ERROR no implementation for `E | ()`
2525
// -------- This looks like an or-pattern but is in fact `|A| (B: E | ())`.
2626

2727
// ...and for now neither do we allow or-patterns at the top level of functions.

Diff for: src/test/ui/pattern/pattern-tyvar-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
enum Bar { T1((), Option<Vec<isize>>), T2, }
22

33
fn foo(t: Bar) -> isize { match t { Bar::T1(_, Some(x)) => { return x * 3; } _ => { panic!(); } } }
4-
//~^ ERROR binary operation `*` cannot be applied to
4+
//~^ ERROR cannot multiply `{integer}` to `std::vec::Vec<isize>`
55

66
fn main() { }

Diff for: src/test/ui/span/issue-39018.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
pub fn main() {
22
let x = "Hello " + "World!";
3-
//~^ ERROR cannot be applied to type
3+
//~^ ERROR cannot add
44

55
// Make sure that the span outputs a warning
66
// for not having an implementation for std::ops::Add
77
// that won't output for the above string concatenation
88
let y = World::Hello + World::Goodbye;
9-
//~^ ERROR cannot be applied to type
9+
//~^ ERROR cannot add
1010

1111
let x = "Hello " + "World!".to_owned();
12-
//~^ ERROR cannot be applied to type
12+
//~^ ERROR cannot add
1313
}
1414

1515
enum World {
@@ -23,16 +23,16 @@ fn foo() {
2323
let c = "";
2424
let d = "";
2525
let e = &a;
26-
let _ = &a + &b; //~ ERROR binary operation
27-
let _ = &a + b; //~ ERROR binary operation
26+
let _ = &a + &b; //~ ERROR cannot add
27+
let _ = &a + b; //~ ERROR cannot add
2828
let _ = a + &b; // ok
2929
let _ = a + b; //~ ERROR mismatched types
30-
let _ = e + b; //~ ERROR binary operation
31-
let _ = e + &b; //~ ERROR binary operation
32-
let _ = e + d; //~ ERROR binary operation
33-
let _ = e + &d; //~ ERROR binary operation
34-
let _ = &c + &d; //~ ERROR binary operation
35-
let _ = &c + d; //~ ERROR binary operation
36-
let _ = c + &d; //~ ERROR binary operation
37-
let _ = c + d; //~ ERROR binary operation
30+
let _ = e + b; //~ ERROR cannot add
31+
let _ = e + &b; //~ ERROR cannot add
32+
let _ = e + d; //~ ERROR cannot add
33+
let _ = e + &d; //~ ERROR cannot add
34+
let _ = &c + &d; //~ ERROR cannot add
35+
let _ = &c + d; //~ ERROR cannot add
36+
let _ = c + &d; //~ ERROR cannot add
37+
let _ = c + d; //~ ERROR cannot add
3838
}

Diff for: src/test/ui/str/str-concat-on-double-ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ fn main() {
22
let a: &String = &"1".to_owned();
33
let b: &str = &"2";
44
let c = a + b;
5-
//~^ ERROR binary operation `+` cannot be applied to type `&std::string::String`
5+
//~^ ERROR cannot add `&str` to `&std::string::String`
66
println!("{:?}", c);
77
}

Diff for: src/test/ui/terminal-width/non-1-width-unicode-multiline-label.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
fn main() {
44
let unicode_is_fun = "؁‱ஹ௸௵꧄.ဪ꧅⸻𒈙𒐫﷽𒌄𒈟𒍼𒁎𒀱𒌧𒅃 𒈓𒍙𒊎𒄡𒅌𒁏𒀰𒐪𒐩𒈙𒐫𪚥";
55
let _ = "ༀ༁༂༃༄༅༆༇༈༉༊་༌།༎༏༐༑༒༓༔༕༖༗༘༙༚༛༜༝༞༟༠༡༢༣༤༥༦༧༨༩༪༫༬༭༮༯༰༱༲༳༴༵༶༷༸༹༺༻༼༽༾༿ཀཁགགྷངཅཆཇ཈ཉཊཋཌཌྷཎཏཐདདྷནཔཕབབྷམཙཚཛཛྷཝཞཟའཡརལཤཥསཧཨཀྵཪཫཬ཭཮཯཰ཱཱཱིིུུྲྀཷླྀཹེཻོཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔྕྖྗ྘ྙྚྛྜྜྷྞྟྠྡྡྷྣྤྥྦྦྷྨྩྪྫྫྷྭྮྯྰྱྲླྴྵྶྷྸྐྵྺྻྼ྽྾྿࿀࿁࿂࿃࿄࿅࿆࿇࿈࿉࿊࿋࿌࿍࿎࿏࿐࿑࿒࿓࿔࿕࿖࿗࿘࿙࿚"; let _a = unicode_is_fun + " really fun!";
6-
//~^ ERROR binary operation `+` cannot be applied to type `&str`
6+
//~^ ERROR cannot add `&str` to `&str`
77
}

Diff for: src/test/ui/traits/trait-resolution-in-overloaded-op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ trait MyMul<Rhs, Res> {
55
}
66

77
fn foo<T: MyMul<f64, f64>>(a: &T, b: f64) -> f64 {
8-
a * b //~ ERROR binary operation `*` cannot be applied to type `&T`
8+
a * b //~ ERROR cannot multiply `f64` to `&T`
99
}
1010

1111
fn main() {}

Diff for: src/test/ui/type/type-check/missing_trait_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fn main() {
22
}
33

44
fn foo<T>(x: T, y: T) {
5-
let z = x + y; //~ ERROR binary operation `+` cannot be applied to type `T`
5+
let z = x + y; //~ ERROR cannot add `T` to `T`
66
}
77

88
fn bar<T>(x: T) {

Diff for: src/test/ui/vec/vec-res-add.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ fn main() {
1414
let i = vec![r(0)];
1515
let j = vec![r(1)];
1616
let k = i + j;
17-
//~^ ERROR binary operation `+` cannot be applied to type
17+
//~^ ERROR cannot add `std::vec::Vec<R>` to `std::vec::Vec<R>`
1818
println!("{:?}", j);
1919
}

0 commit comments

Comments
 (0)