diff --git a/src/test/ui/autoderef-full-lval.rs b/src/test/ui/autoderef-full-lval.rs index db09d036ad3b8..4bef1012e33de 100644 --- a/src/test/ui/autoderef-full-lval.rs +++ b/src/test/ui/autoderef-full-lval.rs @@ -13,13 +13,13 @@ fn main() { let a: Clam = Clam{x: box 1, y: box 2}; let b: Clam = Clam{x: box 10, y: box 20}; let z: isize = a.x + b.y; - //~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box` + //~^ ERROR cannot add `std::boxed::Box` to `std::boxed::Box` println!("{}", z); assert_eq!(z, 21); let forty: Fish = Fish{a: box 40}; let two: Fish = Fish{a: box 2}; let answer: isize = forty.a + two.a; - //~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box` + //~^ ERROR cannot add `std::boxed::Box` to `std::boxed::Box` println!("{}", answer); assert_eq!(answer, 42); } diff --git a/src/test/ui/binary-op-on-double-ref.rs b/src/test/ui/binary-op-on-double-ref.rs index 6490cc7fe5689..67e01b9327db1 100644 --- a/src/test/ui/binary-op-on-double-ref.rs +++ b/src/test/ui/binary-op-on-double-ref.rs @@ -2,7 +2,7 @@ fn main() { let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9]; let vr = v.iter().filter(|x| { x % 2 == 0 - //~^ ERROR binary operation `%` cannot be applied to type `&&{integer}` + //~^ ERROR cannot mod `&&{integer}` by `{integer}` }); println!("{:?}", vr); } diff --git a/src/test/ui/binop/binop-bitxor-str.rs b/src/test/ui/binop/binop-bitxor-str.rs index 6021c344dfb65..e98ea4df97def 100644 --- a/src/test/ui/binop/binop-bitxor-str.rs +++ b/src/test/ui/binop/binop-bitxor-str.rs @@ -1,3 +1,3 @@ -// error-pattern:`^` cannot be applied to type `std::string::String` +// error-pattern:no implementation for `std::string::String ^ std::string::String` fn main() { let x = "a".to_string() ^ "b".to_string(); } diff --git a/src/test/ui/binop/binop-mul-bool.rs b/src/test/ui/binop/binop-mul-bool.rs index 3d5349ba880fc..27b2f8bb3ff30 100644 --- a/src/test/ui/binop/binop-mul-bool.rs +++ b/src/test/ui/binop/binop-mul-bool.rs @@ -1,3 +1,3 @@ -// error-pattern:`*` cannot be applied to type `bool` +// error-pattern:cannot multiply `bool` to `bool` fn main() { let x = true * false; } diff --git a/src/test/ui/binop/binop-typeck.rs b/src/test/ui/binop/binop-typeck.rs index e1185cfba266c..812fe95db4e57 100644 --- a/src/test/ui/binop/binop-typeck.rs +++ b/src/test/ui/binop/binop-typeck.rs @@ -4,5 +4,5 @@ fn main() { let x = true; let y = 1; let z = x + y; - //~^ ERROR binary operation `+` cannot be applied to type `bool` + //~^ ERROR cannot add `{integer}` to `bool` } diff --git a/src/test/ui/for/for-loop-type-error.rs b/src/test/ui/for/for-loop-type-error.rs index 879fa47549e98..8d9fc20f0d0d6 100644 --- a/src/test/ui/for/for-loop-type-error.rs +++ b/src/test/ui/for/for-loop-type-error.rs @@ -1,5 +1,5 @@ pub fn main() { - let x = () + (); //~ ERROR binary operation + let x = () + (); //~ ERROR cannot add `()` to `()` // this shouldn't have a flow-on error: for _ in x {} diff --git a/src/test/ui/issues/issue-14915.rs b/src/test/ui/issues/issue-14915.rs index 294533f0cbb75..4acb51a4e50fa 100644 --- a/src/test/ui/issues/issue-14915.rs +++ b/src/test/ui/issues/issue-14915.rs @@ -4,5 +4,5 @@ fn main() { let x: Box = box 0; println!("{}", x + 1); - //~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box` + //~^ ERROR cannot add `{integer}` to `std::boxed::Box` } diff --git a/src/test/ui/issues/issue-24363.rs b/src/test/ui/issues/issue-24363.rs index a5b45f13e74ad..34726fba9c66a 100644 --- a/src/test/ui/issues/issue-24363.rs +++ b/src/test/ui/issues/issue-24363.rs @@ -1,6 +1,6 @@ fn main() { 1.create_a_type_error[ //~ `{integer}` is a primitive type and therefore doesn't have fields - ()+() //~ ERROR binary operation `+` cannot be applied + ()+() //~ ERROR cannot add // ^ ensure that we typeck the inner expression ^ ]; } diff --git a/src/test/ui/issues/issue-28837.rs b/src/test/ui/issues/issue-28837.rs index 114473f3acfec..438a4c521b198 100644 --- a/src/test/ui/issues/issue-28837.rs +++ b/src/test/ui/issues/issue-28837.rs @@ -3,23 +3,23 @@ struct A; fn main() { let a = A; - a + a; //~ ERROR binary operation `+` cannot be applied to type `A` + a + a; //~ ERROR cannot add `A` to `A` - a - a; //~ ERROR binary operation `-` cannot be applied to type `A` + a - a; //~ ERROR cannot substract `A` from `A` - a * a; //~ ERROR binary operation `*` cannot be applied to type `A` + a * a; //~ ERROR cannot multiply `A` to `A` - a / a; //~ ERROR binary operation `/` cannot be applied to type `A` + a / a; //~ ERROR cannot divide `A` by `A` - a % a; //~ ERROR binary operation `%` cannot be applied to type `A` + a % a; //~ ERROR cannot mod `A` by `A` - a & a; //~ ERROR binary operation `&` cannot be applied to type `A` + a & a; //~ ERROR no implementation for `A & A` - a | a; //~ ERROR binary operation `|` cannot be applied to type `A` + a | a; //~ ERROR no implementation for `A | A` - a << a; //~ ERROR binary operation `<<` cannot be applied to type `A` + a << a; //~ ERROR no implementation for `A << A` - a >> a; //~ ERROR binary operation `>>` cannot be applied to type `A` + a >> a; //~ ERROR no implementation for `A >> A` a == a; //~ ERROR binary operation `==` cannot be applied to type `A` diff --git a/src/test/ui/issues/issue-31076.rs b/src/test/ui/issues/issue-31076.rs index e4531072e9be4..f9c35526ec342 100644 --- a/src/test/ui/issues/issue-31076.rs +++ b/src/test/ui/issues/issue-31076.rs @@ -11,7 +11,7 @@ impl Add for i32 {} fn main() { let x = 5 + 6; - //~^ ERROR binary operation `+` cannot be applied to type `{integer}` + //~^ ERROR cannot add `{integer}` to `{integer}` let y = 5i32 + 6i32; - //~^ ERROR binary operation `+` cannot be applied to type `i32` + //~^ ERROR cannot add `i32` to `i32` } diff --git a/src/test/ui/issues/issue-35668.rs b/src/test/ui/issues/issue-35668.rs index 1b8ada57ed69c..6f6dfb00f86b7 100644 --- a/src/test/ui/issues/issue-35668.rs +++ b/src/test/ui/issues/issue-35668.rs @@ -1,6 +1,6 @@ fn func<'a, T>(a: &'a [T]) -> impl Iterator { a.iter().map(|a| a*a) - //~^ ERROR binary operation `*` cannot be applied to type `&T` + //~^ ERROR cannot multiply `&T` to `&T` } fn main() { diff --git a/src/test/ui/issues/issue-3820.rs b/src/test/ui/issues/issue-3820.rs index fbf60ce278df2..c090654623206 100644 --- a/src/test/ui/issues/issue-3820.rs +++ b/src/test/ui/issues/issue-3820.rs @@ -11,5 +11,5 @@ impl Thing { fn main() { let u = Thing {x: 2}; let _v = u.mul(&3); // This is ok - let w = u * 3; //~ ERROR binary operation `*` cannot be applied to type `Thing` + let w = u * 3; //~ ERROR cannot multiply `{integer}` to `Thing` } diff --git a/src/test/ui/issues/issue-40610.rs b/src/test/ui/issues/issue-40610.rs index 104cf7f54e5f3..c01233605b57c 100644 --- a/src/test/ui/issues/issue-40610.rs +++ b/src/test/ui/issues/issue-40610.rs @@ -2,5 +2,5 @@ fn f(_: &[f32]) {} fn main() { () + f(&[1.0]); - //~^ ERROR binary operation `+` cannot be applied to type `()` + //~^ ERROR cannot add `()` to `()` } diff --git a/src/test/ui/issues/issue-41394.rs b/src/test/ui/issues/issue-41394.rs index 45318f6efb892..64873ac35a002 100644 --- a/src/test/ui/issues/issue-41394.rs +++ b/src/test/ui/issues/issue-41394.rs @@ -1,6 +1,6 @@ enum Foo { A = "" + 1 - //~^ ERROR binary operation `+` cannot be applied to type `&str` + //~^ ERROR cannot add `{integer}` to `&str` } enum Bar { diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-fail.rs b/src/test/ui/or-patterns/or-patterns-syntactic-fail.rs index b676ea851a3ba..ce6836f30f946 100644 --- a/src/test/ui/or-patterns/or-patterns-syntactic-fail.rs +++ b/src/test/ui/or-patterns/or-patterns-syntactic-fail.rs @@ -21,7 +21,7 @@ use E::*; fn no_top_level_or_patterns() { // We do *not* allow or-patterns at the top level of lambdas... - let _ = |A | B: E| (); //~ ERROR binary operation `|` cannot be applied to type `E` + let _ = |A | B: E| (); //~ ERROR no implementation for `E | ()` // -------- This looks like an or-pattern but is in fact `|A| (B: E | ())`. // ...and for now neither do we allow or-patterns at the top level of functions. diff --git a/src/test/ui/pattern/pattern-tyvar-2.rs b/src/test/ui/pattern/pattern-tyvar-2.rs index 9fba9cb876a25..4c6d515b86af3 100644 --- a/src/test/ui/pattern/pattern-tyvar-2.rs +++ b/src/test/ui/pattern/pattern-tyvar-2.rs @@ -1,6 +1,6 @@ enum Bar { T1((), Option>), T2, } fn foo(t: Bar) -> isize { match t { Bar::T1(_, Some(x)) => { return x * 3; } _ => { panic!(); } } } -//~^ ERROR binary operation `*` cannot be applied to +//~^ ERROR cannot multiply `{integer}` to `std::vec::Vec` fn main() { } diff --git a/src/test/ui/span/issue-39018.rs b/src/test/ui/span/issue-39018.rs index a3b1d1d81799f..b6db4008db0d7 100644 --- a/src/test/ui/span/issue-39018.rs +++ b/src/test/ui/span/issue-39018.rs @@ -1,15 +1,15 @@ pub fn main() { let x = "Hello " + "World!"; - //~^ ERROR cannot be applied to type + //~^ ERROR cannot add // Make sure that the span outputs a warning // for not having an implementation for std::ops::Add // that won't output for the above string concatenation let y = World::Hello + World::Goodbye; - //~^ ERROR cannot be applied to type + //~^ ERROR cannot add let x = "Hello " + "World!".to_owned(); - //~^ ERROR cannot be applied to type + //~^ ERROR cannot add } enum World { @@ -23,16 +23,16 @@ fn foo() { let c = ""; let d = ""; let e = &a; - let _ = &a + &b; //~ ERROR binary operation - let _ = &a + b; //~ ERROR binary operation + let _ = &a + &b; //~ ERROR cannot add + let _ = &a + b; //~ ERROR cannot add let _ = a + &b; // ok let _ = a + b; //~ ERROR mismatched types - let _ = e + b; //~ ERROR binary operation - let _ = e + &b; //~ ERROR binary operation - let _ = e + d; //~ ERROR binary operation - let _ = e + &d; //~ ERROR binary operation - let _ = &c + &d; //~ ERROR binary operation - let _ = &c + d; //~ ERROR binary operation - let _ = c + &d; //~ ERROR binary operation - let _ = c + d; //~ ERROR binary operation + let _ = e + b; //~ ERROR cannot add + let _ = e + &b; //~ ERROR cannot add + let _ = e + d; //~ ERROR cannot add + let _ = e + &d; //~ ERROR cannot add + let _ = &c + &d; //~ ERROR cannot add + let _ = &c + d; //~ ERROR cannot add + let _ = c + &d; //~ ERROR cannot add + let _ = c + d; //~ ERROR cannot add } diff --git a/src/test/ui/str/str-concat-on-double-ref.rs b/src/test/ui/str/str-concat-on-double-ref.rs index a671b6e191eeb..23e5f8920622e 100644 --- a/src/test/ui/str/str-concat-on-double-ref.rs +++ b/src/test/ui/str/str-concat-on-double-ref.rs @@ -2,6 +2,6 @@ fn main() { let a: &String = &"1".to_owned(); let b: &str = &"2"; let c = a + b; - //~^ ERROR binary operation `+` cannot be applied to type `&std::string::String` + //~^ ERROR cannot add `&str` to `&std::string::String` println!("{:?}", c); } diff --git a/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.rs b/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.rs index cc94680530cf2..1989ea8863592 100644 --- a/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.rs +++ b/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.rs @@ -3,5 +3,5 @@ fn main() { let unicode_is_fun = "؁‱ஹ௸௵꧄.ဪ꧅⸻𒈙𒐫﷽𒌄𒈟𒍼𒁎𒀱𒌧𒅃 𒈓𒍙𒊎𒄡𒅌𒁏𒀰𒐪𒐩𒈙𒐫𪚥"; let _ = "ༀ༁༂༃༄༅༆༇༈༉༊་༌།༎༏༐༑༒༓༔༕༖༗༘༙༚༛༜༝༞༟༠༡༢༣༤༥༦༧༨༩༪༫༬༭༮༯༰༱༲༳༴༵༶༷༸༹༺༻༼༽༾༿ཀཁགགྷངཅཆཇ཈ཉཊཋཌཌྷཎཏཐདདྷནཔཕབབྷམཙཚཛཛྷཝཞཟའཡརལཤཥསཧཨཀྵཪཫཬ཭཮཯཰ཱཱཱིིུུྲྀཷླྀཹེཻོཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔྕྖྗ྘ྙྚྛྜྜྷྞྟྠྡྡྷྣྤྥྦྦྷྨྩྪྫྫྷྭྮྯྰྱྲླྴྵྶྷྸྐྵྺྻྼ྽྾྿࿀࿁࿂࿃࿄࿅࿆࿇࿈࿉࿊࿋࿌࿍࿎࿏࿐࿑࿒࿓࿔࿕࿖࿗࿘࿙࿚"; let _a = unicode_is_fun + " really fun!"; - //~^ ERROR binary operation `+` cannot be applied to type `&str` + //~^ ERROR cannot add `&str` to `&str` } diff --git a/src/test/ui/traits/trait-resolution-in-overloaded-op.rs b/src/test/ui/traits/trait-resolution-in-overloaded-op.rs index 96f81a21a3bc1..286776985168f 100644 --- a/src/test/ui/traits/trait-resolution-in-overloaded-op.rs +++ b/src/test/ui/traits/trait-resolution-in-overloaded-op.rs @@ -5,7 +5,7 @@ trait MyMul { } fn foo>(a: &T, b: f64) -> f64 { - a * b //~ ERROR binary operation `*` cannot be applied to type `&T` + a * b //~ ERROR cannot multiply `f64` to `&T` } fn main() {} diff --git a/src/test/ui/type/type-check/missing_trait_impl.rs b/src/test/ui/type/type-check/missing_trait_impl.rs index dcca96b509b16..f61ada3f63ff9 100644 --- a/src/test/ui/type/type-check/missing_trait_impl.rs +++ b/src/test/ui/type/type-check/missing_trait_impl.rs @@ -2,7 +2,7 @@ fn main() { } fn foo(x: T, y: T) { - let z = x + y; //~ ERROR binary operation `+` cannot be applied to type `T` + let z = x + y; //~ ERROR cannot add `T` to `T` } fn bar(x: T) { diff --git a/src/test/ui/vec/vec-res-add.rs b/src/test/ui/vec/vec-res-add.rs index ea2aa6cda240a..4785178fb2575 100644 --- a/src/test/ui/vec/vec-res-add.rs +++ b/src/test/ui/vec/vec-res-add.rs @@ -14,6 +14,6 @@ fn main() { let i = vec![r(0)]; let j = vec![r(1)]; let k = i + j; - //~^ ERROR binary operation `+` cannot be applied to type + //~^ ERROR cannot add `std::vec::Vec` to `std::vec::Vec` println!("{:?}", j); }