about summary refs log tree commit diff
path: root/src/test/ui/span
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-19 10:29:51 +0100
committerGitHub <noreply@github.com>2019-12-19 10:29:51 +0100
commiteac5fb8b0ab8570b8475545f4378cb35481e9fa6 (patch)
tree1fb34c1dc6715165572225efa030258937d4355f /src/test/ui/span
parentc605199e89572e586a5f37bc698c48b6a10896fb (diff)
parente4abcfbd34f759c33da6f6d7e37235c15ede07c2 (diff)
Rollup merge of #67189 - LeSeulArtichaut:binop-wording, r=estebank
Unify binop wording

Closes #60497
r? @estebank
Diffstat (limited to 'src/test/ui/span')
-rw-r--r--src/test/ui/span/issue-39018.rs26
-rw-r--r--src/test/ui/span/issue-39018.stderr26
2 files changed, 26 insertions, 26 deletions
diff --git a/src/test/ui/span/issue-39018.rs b/src/test/ui/span/issue-39018.rs
index a3b1d1d8179..b6db4008db0 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/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr
index 9637d1d82ec..8a32561bd01 100644
--- a/src/test/ui/span/issue-39018.stderr
+++ b/src/test/ui/span/issue-39018.stderr
@@ -1,4 +1,4 @@
-error[E0369]: binary operation `+` cannot be applied to type `&str`
+error[E0369]: cannot add `&str` to `&str`
   --> $DIR/issue-39018.rs:2:22
    |
 LL |     let x = "Hello " + "World!";
@@ -12,7 +12,7 @@ help: `to_owned()` can be used to create an owned `String` from a string referen
 LL |     let x = "Hello ".to_owned() + "World!";
    |             ^^^^^^^^^^^^^^^^^^^
 
-error[E0369]: binary operation `+` cannot be applied to type `World`
+error[E0369]: cannot add `World` to `World`
   --> $DIR/issue-39018.rs:8:26
    |
 LL |     let y = World::Hello + World::Goodbye;
@@ -22,7 +22,7 @@ LL |     let y = World::Hello + World::Goodbye;
    |
    = note: an implementation of `std::ops::Add` might be missing for `World`
 
-error[E0369]: binary operation `+` cannot be applied to type `&str`
+error[E0369]: cannot add `std::string::String` to `&str`
   --> $DIR/issue-39018.rs:11:22
    |
 LL |     let x = "Hello " + "World!".to_owned();
@@ -36,7 +36,7 @@ help: `to_owned()` can be used to create an owned `String` from a string referen
 LL |     let x = "Hello ".to_owned() + &"World!".to_owned();
    |             ^^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^^^^
 
-error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
+error[E0369]: cannot add `&std::string::String` to `&std::string::String`
   --> $DIR/issue-39018.rs:26:16
    |
 LL |     let _ = &a + &b;
@@ -50,7 +50,7 @@ help: String concatenation appends the string on the right to the string on the
 LL |     let _ = a + &b;
    |             ^
 
-error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
+error[E0369]: cannot add `std::string::String` to `&std::string::String`
   --> $DIR/issue-39018.rs:27:16
    |
 LL |     let _ = &a + b;
@@ -73,7 +73,7 @@ LL |     let _ = a + b;
    |                 expected `&str`, found struct `std::string::String`
    |                 help: consider borrowing here: `&b`
 
-error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
+error[E0369]: cannot add `std::string::String` to `&std::string::String`
   --> $DIR/issue-39018.rs:30:15
    |
 LL |     let _ = e + b;
@@ -87,7 +87,7 @@ help: `to_owned()` can be used to create an owned `String` from a string referen
 LL |     let _ = e.to_owned() + &b;
    |             ^^^^^^^^^^^^   ^^
 
-error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
+error[E0369]: cannot add `&std::string::String` to `&std::string::String`
   --> $DIR/issue-39018.rs:31:15
    |
 LL |     let _ = e + &b;
@@ -101,7 +101,7 @@ help: `to_owned()` can be used to create an owned `String` from a string referen
 LL |     let _ = e.to_owned() + &b;
    |             ^^^^^^^^^^^^
 
-error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
+error[E0369]: cannot add `&str` to `&std::string::String`
   --> $DIR/issue-39018.rs:32:15
    |
 LL |     let _ = e + d;
@@ -115,7 +115,7 @@ help: `to_owned()` can be used to create an owned `String` from a string referen
 LL |     let _ = e.to_owned() + d;
    |             ^^^^^^^^^^^^
 
-error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
+error[E0369]: cannot add `&&str` to `&std::string::String`
   --> $DIR/issue-39018.rs:33:15
    |
 LL |     let _ = e + &d;
@@ -129,7 +129,7 @@ help: `to_owned()` can be used to create an owned `String` from a string referen
 LL |     let _ = e.to_owned() + &d;
    |             ^^^^^^^^^^^^
 
-error[E0369]: binary operation `+` cannot be applied to type `&&str`
+error[E0369]: cannot add `&&str` to `&&str`
   --> $DIR/issue-39018.rs:34:16
    |
 LL |     let _ = &c + &d;
@@ -139,7 +139,7 @@ LL |     let _ = &c + &d;
    |
    = note: an implementation of `std::ops::Add` might be missing for `&&str`
 
-error[E0369]: binary operation `+` cannot be applied to type `&&str`
+error[E0369]: cannot add `&str` to `&&str`
   --> $DIR/issue-39018.rs:35:16
    |
 LL |     let _ = &c + d;
@@ -149,7 +149,7 @@ LL |     let _ = &c + d;
    |
    = note: an implementation of `std::ops::Add` might be missing for `&&str`
 
-error[E0369]: binary operation `+` cannot be applied to type `&str`
+error[E0369]: cannot add `&&str` to `&str`
   --> $DIR/issue-39018.rs:36:15
    |
 LL |     let _ = c + &d;
@@ -163,7 +163,7 @@ help: `to_owned()` can be used to create an owned `String` from a string referen
 LL |     let _ = c.to_owned() + &d;
    |             ^^^^^^^^^^^^
 
-error[E0369]: binary operation `+` cannot be applied to type `&str`
+error[E0369]: cannot add `&str` to `&str`
   --> $DIR/issue-39018.rs:37:15
    |
 LL |     let _ = c + d;