]> git.lizzy.rs Git - rust.git/commitdiff
Update tests
authorLeSeulArtichaut <leseulartichaut@gmail.com>
Wed, 11 Dec 2019 22:11:32 +0000 (23:11 +0100)
committerLeSeulArtichaut <leseulartichaut@gmail.com>
Thu, 12 Dec 2019 19:56:14 +0000 (20:56 +0100)
22 files changed:
src/test/ui/autoderef-full-lval.rs
src/test/ui/binary-op-on-double-ref.rs
src/test/ui/binop/binop-bitxor-str.rs
src/test/ui/binop/binop-mul-bool.rs
src/test/ui/binop/binop-typeck.rs
src/test/ui/for/for-loop-type-error.rs
src/test/ui/issues/issue-14915.rs
src/test/ui/issues/issue-24363.rs
src/test/ui/issues/issue-28837.rs
src/test/ui/issues/issue-31076.rs
src/test/ui/issues/issue-35668.rs
src/test/ui/issues/issue-3820.rs
src/test/ui/issues/issue-40610.rs
src/test/ui/issues/issue-41394.rs
src/test/ui/or-patterns/or-patterns-syntactic-fail.rs
src/test/ui/pattern/pattern-tyvar-2.rs
src/test/ui/span/issue-39018.rs
src/test/ui/str/str-concat-on-double-ref.rs
src/test/ui/terminal-width/non-1-width-unicode-multiline-label.rs
src/test/ui/traits/trait-resolution-in-overloaded-op.rs
src/test/ui/type/type-check/missing_trait_impl.rs
src/test/ui/vec/vec-res-add.rs

index db09d036ad3b86a92c55149c7d3e8cf58e3ac2bf..4bef1012e33deb8895c125f6ccb0a7d840fc56da 100644 (file)
@@ -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<isize>`
+    //~^ ERROR cannot add `std::boxed::Box<isize>` to `std::boxed::Box<isize>`
     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<isize>`
+    //~^ ERROR cannot add `std::boxed::Box<isize>` to `std::boxed::Box<isize>`
     println!("{}", answer);
     assert_eq!(answer, 42);
 }
index 6490cc7fe5689929859f63a656794bb447e6f3c0..67e01b9327db1ec904673ca293afe7cfffb6daa3 100644 (file)
@@ -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);
 }
index 6021c344dfb6556d1a76bcce9b78dfbfed466bbc..e98ea4df97defc71fe5dee49a36e714823fd30bf 100644 (file)
@@ -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(); }
index 3d5349ba880fc4fe4d4e1a5ecbcd2877a79a64bb..27b2f8bb3ff3009ba6c55c705b7cc8ccb58f8a45 100644 (file)
@@ -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; }
index e1185cfba266cb14d854430028a176546ef05a98..812fe95db4e57dcf045135cb6e144ca38058277c 100644 (file)
@@ -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`
 }
index 879fa47549e9854e66b8c0f8905a98a934f133af..8d9fc20f0d0d6ef0dd5189e4fd45d8895c49b2f3 100644 (file)
@@ -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 {}
index 294533f0cbb75c094e118913706281ad9237ab7b..4acb51a4e50fa6ff08281ea6faedf4da716b7445 100644 (file)
@@ -4,5 +4,5 @@ fn main() {
     let x: Box<isize> = box 0;
 
     println!("{}", x + 1);
-    //~^ ERROR binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
+    //~^ ERROR cannot add `{integer}` to `std::boxed::Box<isize>`
 }
index a5b45f13e74ade8d2705e971e9357dd6a491581c..34726fba9c66a58323410c5b3be2db6ea8a9a3b4 100644 (file)
@@ -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 ^
     ];
 }
index 114473f3acfec12e6f94c8917686abe49dca03a3..438a4c521b198f8dcfeaa185f07f826eb77fc8f9 100644 (file)
@@ -3,23 +3,23 @@
 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`
 
index e4531072e9be42c3e6735619de0023e96e6a2564..f9c35526ec3423ac371430bcaeb943ff0b896bf5 100644 (file)
@@ -11,7 +11,7 @@ impl Add<i32> 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`
 }
index 1b8ada57ed69c2c94ab6b8b5a0fa02feda77b7a8..6f6dfb00f86b71f89fd45361279c5a611b35203e 100644 (file)
@@ -1,6 +1,6 @@
 fn func<'a, T>(a: &'a [T]) -> impl Iterator<Item=&'a T> {
     a.iter().map(|a| a*a)
-    //~^ ERROR binary operation `*` cannot be applied to type `&T`
+    //~^ ERROR cannot multiply `&T` to `&T`
 }
 
 fn main() {
index fbf60ce278df262de8b0842b1020c076e36061aa..c090654623206b85b75f097bc6e269fe88457b05 100644 (file)
@@ -11,5 +11,5 @@ fn mul(&self, c: &isize) -> 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`
 }
index 104cf7f54e5f3d9251da736f88e9a68227e1988d..c01233605b57cbbfffada4bccdcf327012b87af9 100644 (file)
@@ -2,5 +2,5 @@ fn f(_: &[f32]) {}
 
 fn main() {
     () + f(&[1.0]);
-    //~^ ERROR binary operation `+` cannot be applied to type `()`
+    //~^ ERROR cannot add `()` to `()`
 }
index 45318f6efb892b667649cddea0593905c7c8acab..64873ac35a00213e78fc7479e75ba180f5029a34 100644 (file)
@@ -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 {
index b676ea851a3ba6b514148defbe5a317705445843..ce6836f30f9461e4ed3e8d12e5b0b0bf107011b0 100644 (file)
@@ -21,7 +21,7 @@ enum E { A, B }
 
 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.
index 9fba9cb876a258d3717de1bd8d0a23bfcdaa9ce4..4c6d515b86af348166d1aed9bf4538cf3c6bcb61 100644 (file)
@@ -1,6 +1,6 @@
 enum Bar { T1((), Option<Vec<isize>>), 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<isize>`
 
 fn main() { }
index a3b1d1d81799fce76716f160f2cd95b64ebcfc80..b6db4008db0d76e634b3e5b2fe4e727a1c3b0920 100644 (file)
@@ -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
 }
index a671b6e191eeb016b0f4e84d179d89c895ad52b5..23e5f8920622e7247625230d74d10f4fb3e5f16f 100644 (file)
@@ -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);
 }
index cc94680530cf253645450c2e273d23f7bb010b59..1989ea8863592038e57e42fb4a0015ac448cccfb 100644 (file)
@@ -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`
 }
index 96f81a21a3bc135f4b71561070c7bc6d8c9757cc..286776985168f78ef5e2f11e0a158efc20b2646c 100644 (file)
@@ -5,7 +5,7 @@ trait MyMul<Rhs, Res> {
 }
 
 fn foo<T: MyMul<f64, f64>>(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() {}
index dcca96b509b16a42c4615eac4b22a3c3189294d6..f61ada3f63ff9a1a9e7afafd4e80526099b9207c 100644 (file)
@@ -2,7 +2,7 @@ fn main() {
 }
 
 fn foo<T>(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<T>(x: T) {
index ea2aa6cda240afcc6a3515c806bf823793781b53..4785178fb2575e825093fe77cd6644d174d1bca4 100644 (file)
@@ -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<R>` to `std::vec::Vec<R>`
     println!("{:?}", j);
 }