]> git.lizzy.rs Git - rust.git/commitdiff
Better diagnostic for binary operation on BoxedValues
authorhgallagher1993 <hgallagher1993@gmail.com>
Wed, 27 Mar 2019 17:13:09 +0000 (13:13 -0400)
committerhgallagher1993 <hgallagher1993@gmail.com>
Wed, 27 Mar 2019 17:13:09 +0000 (13:13 -0400)
30 files changed:
src/librustc_typeck/check/op.rs
src/test/ui/autoderef-full-lval.stderr
src/test/ui/binary-op-on-double-ref.stderr
src/test/ui/binop/binop-bitxor-str.stderr
src/test/ui/binop/binop-mul-bool.stderr
src/test/ui/binop/binop-typeck.stderr
src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
src/test/ui/derives/derives-span-PartialEq-enum.stderr
src/test/ui/derives/derives-span-PartialEq-struct.stderr
src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr
src/test/ui/derives/deriving-no-inner-impl-error-message.stderr
src/test/ui/fn/fn-compare-mismatch.stderr
src/test/ui/for/for-loop-type-error.stderr
src/test/ui/issues/issue-14915.stderr
src/test/ui/issues/issue-24363.stderr
src/test/ui/issues/issue-28837.stderr
src/test/ui/issues/issue-31076.stderr
src/test/ui/issues/issue-35668.stderr
src/test/ui/issues/issue-3820.stderr
src/test/ui/issues/issue-40610.stderr
src/test/ui/issues/issue-41394.stderr
src/test/ui/issues/issue-47377.stderr
src/test/ui/issues/issue-47380.stderr
src/test/ui/parser/require-parens-for-chained-comparison.stderr
src/test/ui/pattern/pattern-tyvar-2.stderr
src/test/ui/span/issue-39018.stderr
src/test/ui/str/str-concat-on-double-ref.stderr
src/test/ui/traits/trait-resolution-in-overloaded-op.stderr
src/test/ui/type/type-check/missing_trait_impl.stderr
src/test/ui/vec/vec-res-add.stderr

index 9d883b22214f7a3163e37fcb60cd89b6d7378130..f8212659f020ca15b7830d85f50dac620af80b89 100644 (file)
@@ -327,10 +327,14 @@ fn check_overloaded_binop(&self,
                             err.emit();
                         }
                         IsAssign::No => {
-                            let mut err = struct_span_err!(self.tcx.sess, expr.span, E0369,
+                            let mut err = struct_span_err!(self.tcx.sess, op.span, E0369,
                                 "binary operation `{}` cannot be applied to type `{}`",
                                 op.node.as_str(),
                                 lhs_ty);
+
+                            err.span_label(lhs_expr.span, lhs_ty.to_string());
+                            err.span_label(rhs_expr.span, rhs_ty.to_string());
+
                             let mut suggested_deref = false;
                             if let Ref(_, mut rty, _) = lhs_ty.sty {
                                 if {
index b92259b69df8e6153d948b445c8e9e2ca7859182..c9f3e8b2e26c552efce32b943718f1c3b795b541 100644 (file)
@@ -1,16 +1,20 @@
 error[E0369]: binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
-  --> $DIR/autoderef-full-lval.rs:15:20
+  --> $DIR/autoderef-full-lval.rs:15:24
    |
 LL |     let z: isize = a.x + b.y;
-   |                    ^^^^^^^^^
+   |                    --- ^ --- std::boxed::Box<isize>
+   |                    |
+   |                    std::boxed::Box<isize>
    |
    = note: an implementation of `std::ops::Add` might be missing for `std::boxed::Box<isize>`
 
 error[E0369]: binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
-  --> $DIR/autoderef-full-lval.rs:21:25
+  --> $DIR/autoderef-full-lval.rs:21:33
    |
 LL |     let answer: isize = forty.a + two.a;
-   |                         ^^^^^^^^^^^^^^^
+   |                         ------- ^ ----- std::boxed::Box<isize>
+   |                         |
+   |                         std::boxed::Box<isize>
    |
    = note: an implementation of `std::ops::Add` might be missing for `std::boxed::Box<isize>`
 
index f298902e3ff12b540de4815e62e413f45ef704ce..d036f06a8c7d0321bc1d0ffa496408d679976265 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `%` cannot be applied to type `&&{integer}`
-  --> $DIR/binary-op-on-double-ref.rs:4:9
+  --> $DIR/binary-op-on-double-ref.rs:4:11
    |
 LL |         x % 2 == 0
-   |         ^^^^^
+   |         - ^ - {integer}
+   |         |
+   |         &&{integer}
    |
    = help: `%` can be used on '{integer}', you can dereference `x`: `*x`
 
index 4404fde9200c8d185c18cc700f4acab2fcb803e3..9e8992235edd1d3e760bed8da3ccf2182ac71b5e 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `^` cannot be applied to type `std::string::String`
-  --> $DIR/binop-bitxor-str.rs:3:21
+  --> $DIR/binop-bitxor-str.rs:3:37
    |
 LL | fn main() { let x = "a".to_string() ^ "b".to_string(); }
-   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                     --------------- ^ --------------- std::string::String
+   |                     |
+   |                     std::string::String
    |
    = note: an implementation of `std::ops::BitXor` might be missing for `std::string::String`
 
index 194181b9c11c39b5a71ae4cdb05eee0032d8f9bd..92e14bccccd5818b5d23fe75d730537e34e49680 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `*` cannot be applied to type `bool`
-  --> $DIR/binop-mul-bool.rs:3:21
+  --> $DIR/binop-mul-bool.rs:3:26
    |
 LL | fn main() { let x = true * false; }
-   |                     ^^^^^^^^^^^^
+   |                     ---- ^ ----- bool
+   |                     |
+   |                     bool
    |
    = note: an implementation of `std::ops::Mul` might be missing for `bool`
 
index 928e836c0b51e2907a57de4a43dcae5df09c5e14..d33cff313e7f9f34e890e48b1526fbb88eff5155 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `+` cannot be applied to type `bool`
-  --> $DIR/binop-typeck.rs:6:13
+  --> $DIR/binop-typeck.rs:6:15
    |
 LL |     let z = x + y;
-   |             ^^^^^
+   |             - ^ - {integer}
+   |             |
+   |             bool
    |
    = note: an implementation of `std::ops::Add` might be missing for `bool`
 
index ed5468cc4dac2d5574da7dfb48ff2fc4c4e5a7c1..673f23d29eb78df91d4d4026ad48b57030699b44 100644 (file)
@@ -3,6 +3,9 @@ error[E0369]: binary operation `==` cannot be applied to type `Error`
    |
 LL |      x: Error
    |      ^^^^^^^^
+   |      |
+   |      Error
+   |      Error
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
 
@@ -11,6 +14,9 @@ error[E0369]: binary operation `!=` cannot be applied to type `Error`
    |
 LL |      x: Error
    |      ^^^^^^^^
+   |      |
+   |      Error
+   |      Error
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
 
index 06a88c03f58afbd46560c19725422f59252d22be..6ab18b45b7387af4fc69db100e06e8318bd49d93 100644 (file)
@@ -3,6 +3,9 @@ error[E0369]: binary operation `==` cannot be applied to type `Error`
    |
 LL |      Error
    |      ^^^^^
+   |      |
+   |      Error
+   |      Error
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
 
@@ -11,6 +14,9 @@ error[E0369]: binary operation `!=` cannot be applied to type `Error`
    |
 LL |      Error
    |      ^^^^^
+   |      |
+   |      Error
+   |      Error
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
 
index b8481048361e5d50a43113f9b4c0c886fdc5eb99..bdd12942b4710ec420ea000302ab68e637174185 100644 (file)
@@ -3,6 +3,9 @@ error[E0369]: binary operation `==` cannot be applied to type `Error`
    |
 LL |     x: Error
    |     ^^^^^^^^
+   |     |
+   |     Error
+   |     Error
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
 
@@ -11,6 +14,9 @@ error[E0369]: binary operation `!=` cannot be applied to type `Error`
    |
 LL |     x: Error
    |     ^^^^^^^^
+   |     |
+   |     Error
+   |     Error
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
 
index 4398d25212550bcd842811f7168f31426a5a5187..9f60b2ea8166b2b9993a673916f6a71a743a8d22 100644 (file)
@@ -3,6 +3,9 @@ error[E0369]: binary operation `==` cannot be applied to type `Error`
    |
 LL |     Error
    |     ^^^^^
+   |     |
+   |     Error
+   |     Error
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
 
@@ -11,6 +14,9 @@ error[E0369]: binary operation `!=` cannot be applied to type `Error`
    |
 LL |     Error
    |     ^^^^^
+   |     |
+   |     Error
+   |     Error
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `Error`
 
index 3206eecbe30e4effe2ce20d4a2eb432f0d42638b..4baf27c520c5900a46bd2c9592888a921e46cac1 100644 (file)
@@ -3,6 +3,9 @@ error[E0369]: binary operation `==` cannot be applied to type `NoCloneOrEq`
    |
 LL |     x: NoCloneOrEq
    |     ^^^^^^^^^^^^^^
+   |     |
+   |     NoCloneOrEq
+   |     NoCloneOrEq
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `NoCloneOrEq`
 
@@ -11,6 +14,9 @@ error[E0369]: binary operation `!=` cannot be applied to type `NoCloneOrEq`
    |
 LL |     x: NoCloneOrEq
    |     ^^^^^^^^^^^^^^
+   |     |
+   |     NoCloneOrEq
+   |     NoCloneOrEq
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `NoCloneOrEq`
 
index 54dae525ffd0eb010cd7fb24f83f74d889ebe0b7..07b93d9aae7ed6302a16e1a000fc369a03ca8881 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `==` cannot be applied to type `fn() {main::f}`
-  --> $DIR/fn-compare-mismatch.rs:4:13
+  --> $DIR/fn-compare-mismatch.rs:4:15
    |
 LL |     let x = f == g;
-   |             ^^^^^^
+   |             - ^^ - fn() {main::g}
+   |             |
+   |             fn() {main::f}
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `fn() {main::f}`
 
index f1c1d0a53887688d3fe7eb118e4b2519a8e8e671..588e7a0ed339e8d234dc8b1c3cdd640bc2468d0e 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `+` cannot be applied to type `()`
-  --> $DIR/for-loop-type-error.rs:2:13
+  --> $DIR/for-loop-type-error.rs:2:16
    |
 LL |     let x = () + ();
-   |             ^^^^^^^
+   |             -- ^ -- ()
+   |             |
+   |             ()
    |
    = note: an implementation of `std::ops::Add` might be missing for `()`
 
index 411d7a3455238e5bf384d236f1fb3f1bd356341f..e8de44320da9c85b7399ff2341eb38e90e2a2391 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `+` cannot be applied to type `std::boxed::Box<isize>`
-  --> $DIR/issue-14915.rs:6:20
+  --> $DIR/issue-14915.rs:6:22
    |
 LL |     println!("{}", x + 1);
-   |                    ^^^^^
+   |                    - ^ - {integer}
+   |                    |
+   |                    std::boxed::Box<isize>
    |
    = note: an implementation of `std::ops::Add` might be missing for `std::boxed::Box<isize>`
 
index 3399856d3f9a7141b00b4f0649fc666eefb5930c..6f269ba764c5dc9defab6c359d3a770042037e9b 100644 (file)
@@ -5,10 +5,12 @@ LL |     1.create_a_type_error[
    |       ^^^^^^^^^^^^^^^^^^^
 
 error[E0369]: binary operation `+` cannot be applied to type `()`
-  --> $DIR/issue-24363.rs:3:9
+  --> $DIR/issue-24363.rs:3:11
    |
 LL |         ()+()
-   |         ^^^^^
+   |         --^-- ()
+   |         |
+   |         ()
    |
    = note: an implementation of `std::ops::Add` might be missing for `()`
 
index aeb25ce12867e67909b9b3148e01edd339ece2e6..ac2a9f2203d5af89ca2558b56cfeee8a011b2db9 100644 (file)
 error[E0369]: binary operation `+` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:6:5
+  --> $DIR/issue-28837.rs:6:7
    |
 LL |     a + a;
-   |     ^^^^^
+   |     - ^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::ops::Add` might be missing for `A`
 
 error[E0369]: binary operation `-` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:8:5
+  --> $DIR/issue-28837.rs:8:7
    |
 LL |     a - a;
-   |     ^^^^^
+   |     - ^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::ops::Sub` might be missing for `A`
 
 error[E0369]: binary operation `*` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:10:5
+  --> $DIR/issue-28837.rs:10:7
    |
 LL |     a * a;
-   |     ^^^^^
+   |     - ^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::ops::Mul` might be missing for `A`
 
 error[E0369]: binary operation `/` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:12:5
+  --> $DIR/issue-28837.rs:12:7
    |
 LL |     a / a;
-   |     ^^^^^
+   |     - ^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::ops::Div` might be missing for `A`
 
 error[E0369]: binary operation `%` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:14:5
+  --> $DIR/issue-28837.rs:14:7
    |
 LL |     a % a;
-   |     ^^^^^
+   |     - ^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::ops::Rem` might be missing for `A`
 
 error[E0369]: binary operation `&` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:16:5
+  --> $DIR/issue-28837.rs:16:7
    |
 LL |     a & a;
-   |     ^^^^^
+   |     - ^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::ops::BitAnd` might be missing for `A`
 
 error[E0369]: binary operation `|` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:18:5
+  --> $DIR/issue-28837.rs:18:7
    |
 LL |     a | a;
-   |     ^^^^^
+   |     - ^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::ops::BitOr` might be missing for `A`
 
 error[E0369]: binary operation `<<` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:20:5
+  --> $DIR/issue-28837.rs:20:7
    |
 LL |     a << a;
-   |     ^^^^^^
+   |     - ^^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::ops::Shl` might be missing for `A`
 
 error[E0369]: binary operation `>>` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:22:5
+  --> $DIR/issue-28837.rs:22:7
    |
 LL |     a >> a;
-   |     ^^^^^^
+   |     - ^^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::ops::Shr` might be missing for `A`
 
 error[E0369]: binary operation `==` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:24:5
+  --> $DIR/issue-28837.rs:24:7
    |
 LL |     a == a;
-   |     ^^^^^^
+   |     - ^^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `A`
 
 error[E0369]: binary operation `!=` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:26:5
+  --> $DIR/issue-28837.rs:26:7
    |
 LL |     a != a;
-   |     ^^^^^^
+   |     - ^^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `A`
 
 error[E0369]: binary operation `<` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:28:5
+  --> $DIR/issue-28837.rs:28:7
    |
 LL |     a < a;
-   |     ^^^^^
+   |     - ^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::cmp::PartialOrd` might be missing for `A`
 
 error[E0369]: binary operation `<=` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:30:5
+  --> $DIR/issue-28837.rs:30:7
    |
 LL |     a <= a;
-   |     ^^^^^^
+   |     - ^^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::cmp::PartialOrd` might be missing for `A`
 
 error[E0369]: binary operation `>` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:32:5
+  --> $DIR/issue-28837.rs:32:7
    |
 LL |     a > a;
-   |     ^^^^^
+   |     - ^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::cmp::PartialOrd` might be missing for `A`
 
 error[E0369]: binary operation `>=` cannot be applied to type `A`
-  --> $DIR/issue-28837.rs:34:5
+  --> $DIR/issue-28837.rs:34:7
    |
 LL |     a >= a;
-   |     ^^^^^^
+   |     - ^^ - A
+   |     |
+   |     A
    |
    = note: an implementation of `std::cmp::PartialOrd` might be missing for `A`
 
index 3a13f02d9f45f34fd72086513bdf56319ba7a578..60a3be1c36b753585628a8260d625d8b6c88dc1b 100644 (file)
@@ -1,16 +1,20 @@
 error[E0369]: binary operation `+` cannot be applied to type `{integer}`
-  --> $DIR/issue-31076.rs:13:13
+  --> $DIR/issue-31076.rs:13:15
    |
 LL |     let x = 5 + 6;
-   |             ^^^^^
+   |             - ^ - {integer}
+   |             |
+   |             {integer}
    |
    = note: an implementation of `std::ops::Add` might be missing for `{integer}`
 
 error[E0369]: binary operation `+` cannot be applied to type `i32`
-  --> $DIR/issue-31076.rs:15:13
+  --> $DIR/issue-31076.rs:15:18
    |
 LL |     let y = 5i32 + 6i32;
-   |             ^^^^^^^^^^^
+   |             ---- ^ ---- i32
+   |             |
+   |             i32
    |
    = note: an implementation of `std::ops::Add` might be missing for `i32`
 
index 08ce2faff10abb691c115f737d2c27a1c4d91add..59ca874bd20189cbb71dc27a5e3725615a2239e1 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `*` cannot be applied to type `&T`
-  --> $DIR/issue-35668.rs:2:22
+  --> $DIR/issue-35668.rs:2:23
    |
 LL |     a.iter().map(|a| a*a)
-   |                      ^^^
+   |                      -^- &T
+   |                      |
+   |                      &T
    |
    = note: an implementation of `std::ops::Mul` might be missing for `&T`
 
index b4af9c2d27dbe1d658fe6205725dd7634ca5cfb2..35eceb3b3c63759ac8658d5dcaf7e26d11783e6b 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `*` cannot be applied to type `Thing`
-  --> $DIR/issue-3820.rs:14:13
+  --> $DIR/issue-3820.rs:14:15
    |
 LL |     let w = u * 3;
-   |             ^^^^^
+   |             - ^ - {integer}
+   |             |
+   |             Thing
    |
    = note: an implementation of `std::ops::Mul` might be missing for `Thing`
 
index f441d65b91e4357a27f8febb770284888a2589b3..9d5775919296d982ec4befa46c7c51b615f3baa9 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `+` cannot be applied to type `()`
-  --> $DIR/issue-40610.rs:4:5
+  --> $DIR/issue-40610.rs:4:8
    |
 LL |     () + f(&[1.0]);
-   |     ^^^^^^^^^^^^^^
+   |     -- ^ --------- ()
+   |     |
+   |     ()
    |
    = note: an implementation of `std::ops::Add` might be missing for `()`
 
index bc5c6e798e868f42d7b6f2cf895186d90a2a6777..5de5889d8172d1c064d378658675b49ee529e9f8 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `+` cannot be applied to type `&str`
-  --> $DIR/issue-41394.rs:2:9
+  --> $DIR/issue-41394.rs:2:12
    |
 LL |     A = "" + 1
-   |         ^^^^^^
+   |         -- ^ - {integer}
+   |         |
+   |         &str
    |
    = note: an implementation of `std::ops::Add` might be missing for `&str`
 
index 1e945727746e95c5ad688e9f3c353f97bb619784..f782ad42fcbbf6cb698c72a66b5cff2f46e7cebb 100644 (file)
@@ -1,8 +1,12 @@
 error[E0369]: binary operation `+` cannot be applied to type `&str`
-  --> $DIR/issue-47377.rs:4:12
+  --> $DIR/issue-47377.rs:4:14
    |
 LL |      let _a = b + ", World!";
-   |               ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
+   |               --^-----------
+   |               |   |
+   |               |   &str
+   |               &str
+   |               `+` can't be used to concatenate two `&str` strings
 help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
    |
 LL |      let _a = b.to_owned() + ", World!";
index 84c5df3ca897b0bf7aaadfa94372ce366d48af4f..753892c97e7c67fe8b75e258cdbdc395b7026cfe 100644 (file)
@@ -1,8 +1,12 @@
 error[E0369]: binary operation `+` cannot be applied to type `&str`
-  --> $DIR/issue-47380.rs:3:33
+  --> $DIR/issue-47380.rs:3:35
    |
 LL |     println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
-   |                                      ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
+   |                                      --^-----------
+   |                                      |   |
+   |                                      |   &str
+   |                                      &str
+   |                                      `+` can't be used to concatenate two `&str` strings
 help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
    |
 LL |     println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
index 4597b14321513d7d78283ae1d4a7f7ac9ded4872..8899b0d43cd8bb31e3d646622556e783fb15461a 100644 (file)
@@ -38,10 +38,12 @@ LL |     false == 0 < 2;
               found type `{integer}`
 
 error[E0369]: binary operation `<` cannot be applied to type `fn() {f::<_>}`
-  --> $DIR/require-parens-for-chained-comparison.rs:13:5
+  --> $DIR/require-parens-for-chained-comparison.rs:13:6
    |
 LL |     f<X>();
-   |     ^^^
+   |     -^- X
+   |     |
+   |     fn() {f::<_>}
    |
    = note: an implementation of `std::cmp::PartialOrd` might be missing for `fn() {f::<_>}`
 
index 5218dd916a575ceeb3e40231859bafc951117692..7c6ae499cbb07206c317d0a68ed201af752346b5 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `*` cannot be applied to type `std::vec::Vec<isize>`
-  --> $DIR/pattern-tyvar-2.rs:3:69
+  --> $DIR/pattern-tyvar-2.rs:3:71
    |
 LL | fn foo(t: Bar) -> isize { match t { Bar::T1(_, Some(x)) => { return x * 3; } _ => { panic!(); } } }
-   |                                                                     ^^^^^
+   |                                                                     - ^ - {integer}
+   |                                                                     |
+   |                                                                     std::vec::Vec<isize>
    |
    = note: an implementation of `std::ops::Mul` might be missing for `std::vec::Vec<isize>`
 
index 00f1b11df19e2f706e3201d57fe7c63b657f1336..6e4754839875e45be354887f67092dea4c939fa9 100644 (file)
@@ -1,26 +1,36 @@
 error[E0369]: binary operation `+` cannot be applied to type `&str`
-  --> $DIR/issue-39018.rs:2:13
+  --> $DIR/issue-39018.rs:2:22
    |
 LL |     let x = "Hello " + "World!";
-   |             ^^^^^^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
+   |             ---------^---------
+   |             |          |
+   |             |          &str
+   |             &str
+   |             `+` can't be used to concatenate two `&str` strings
 help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
    |
 LL |     let x = "Hello ".to_owned() + "World!";
    |             ^^^^^^^^^^^^^^^^^^^
 
 error[E0369]: binary operation `+` cannot be applied to type `World`
-  --> $DIR/issue-39018.rs:8:13
+  --> $DIR/issue-39018.rs:8:26
    |
 LL |     let y = World::Hello + World::Goodbye;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |             ------------ ^ -------------- World
+   |             |
+   |             World
    |
    = note: an implementation of `std::ops::Add` might be missing for `World`
 
 error[E0369]: binary operation `+` cannot be applied to type `&str`
-  --> $DIR/issue-39018.rs:11:13
+  --> $DIR/issue-39018.rs:11:22
    |
 LL |     let x = "Hello " + "World!".to_owned();
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `+` can't be used to concatenate a `&str` with a `String`
+   |             ---------^--------------------
+   |             |          |
+   |             |          std::string::String
+   |             &str
+   |             `+` can't be used to concatenate a `&str` with a `String`
 help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
    |
 LL |     let x = "Hello ".to_owned() + &"World!".to_owned();
index a67db1936f07e364c51f41afd8b052ad58f7d9a7..61ebcfdefc31601c5776e8a30372ed8d645d891a 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
-  --> $DIR/str-concat-on-double-ref.rs:4:13
+  --> $DIR/str-concat-on-double-ref.rs:4:15
    |
 LL |     let c = a + b;
-   |             ^^^^^
+   |             - ^ - &str
+   |             |
+   |             &std::string::String
    |
    = note: an implementation of `std::ops::Add` might be missing for `&std::string::String`
 
index 3b10632b818c74ef329c9a5bc23daaf0631eb5c0..d11562e2a001b3694b82733a0eea012a3e037d80 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `*` cannot be applied to type `&T`
-  --> $DIR/trait-resolution-in-overloaded-op.rs:8:5
+  --> $DIR/trait-resolution-in-overloaded-op.rs:8:7
    |
 LL |     a * b
-   |     ^^^^^
+   |     - ^ - f64
+   |     |
+   |     &T
    |
    = note: an implementation of `std::ops::Mul` might be missing for `&T`
 
index 69b531d0c846e85415737b3a25e757a67d8d8efc..b0e3c35c7056758bf6302eac05b0c78b49b80caa 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `+` cannot be applied to type `T`
-  --> $DIR/missing_trait_impl.rs:5:13
+  --> $DIR/missing_trait_impl.rs:5:15
    |
 LL |     let z = x + y;
-   |             ^^^^^
+   |             - ^ - T
+   |             |
+   |             T
    |
    = note: `T` might need a bound for `std::ops::Add`
 
index 39552697631dbab21799fb65244b92a9a9bdafb4..78b70f09e900544b549be56605fb7ae3b8df5714 100644 (file)
@@ -1,8 +1,10 @@
 error[E0369]: binary operation `+` cannot be applied to type `std::vec::Vec<R>`
-  --> $DIR/vec-res-add.rs:16:13
+  --> $DIR/vec-res-add.rs:16:15
    |
 LL |     let k = i + j;
-   |             ^^^^^
+   |             - ^ - std::vec::Vec<R>
+   |             |
+   |             std::vec::Vec<R>
    |
    = note: an implementation of `std::ops::Add` might be missing for `std::vec::Vec<R>`