about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-06-25 09:18:25 -0700
committerMichael Goulet <michael@errs.io>2022-07-01 17:38:34 +0000
commitf44ae98ceec2361a47e8822a8f5018d4443018ea (patch)
treea1908624ac25cb7243da3aa317335c8b1d120a46 /src
parent5b9775fe17893cba641a071de7e0a7c8f478c41b (diff)
downloadrust-f44ae98ceec2361a47e8822a8f5018d4443018ea.tar.gz
rust-f44ae98ceec2361a47e8822a8f5018d4443018ea.zip
Only label place where type is needed if span is meaningful
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/array-slice-vec/infer_array_len.stderr1
-rw-r--r--src/test/ui/array-slice-vec/slice-pat-type-mismatches.stderr2
-rw-r--r--src/test/ui/cast/issue-85586.stderr2
-rw-r--r--src/test/ui/impl-trait/hidden-type-is-opaque-2.stderr4
-rw-r--r--src/test/ui/issues/issue-15965.stderr2
-rw-r--r--src/test/ui/issues/issue-20261.stderr2
-rw-r--r--src/test/ui/issues/issue-2151.stderr3
-rw-r--r--src/test/ui/issues/issue-51116.rs1
-rw-r--r--src/test/ui/issues/issue-51116.stderr2
-rw-r--r--src/test/ui/pattern/issue-88074-pat-range-type-inference-err.stderr2
-rw-r--r--src/test/ui/pattern/pat-tuple-bad-type.stderr4
-rw-r--r--src/test/ui/span/issue-42234-unknown-receiver-type.full.stderr4
-rw-r--r--src/test/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr4
-rw-r--r--src/test/ui/span/method-and-field-eager-resolution.stderr8
-rw-r--r--src/test/ui/span/type-annotations-needed-expr.stderr1
-rw-r--r--src/test/ui/type-alias-impl-trait/closures_in_branches.stderr3
-rw-r--r--src/test/ui/typeck/issue-65611.stderr2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr4
18 files changed, 19 insertions, 32 deletions
diff --git a/src/test/ui/array-slice-vec/infer_array_len.stderr b/src/test/ui/array-slice-vec/infer_array_len.stderr
index 8da6d97251b..919550cac30 100644
--- a/src/test/ui/array-slice-vec/infer_array_len.stderr
+++ b/src/test/ui/array-slice-vec/infer_array_len.stderr
@@ -4,7 +4,6 @@ error[E0282]: type annotations needed
 LL |     let [_, _] = a.into();
    |         ^^^^^^
    |
-   = note: type must be known at this point
 help: consider giving this pattern a type
    |
 LL |     let [_, _]: _ = a.into();
diff --git a/src/test/ui/array-slice-vec/slice-pat-type-mismatches.stderr b/src/test/ui/array-slice-vec/slice-pat-type-mismatches.stderr
index 20a5b99845b..70a4cbebeee 100644
--- a/src/test/ui/array-slice-vec/slice-pat-type-mismatches.stderr
+++ b/src/test/ui/array-slice-vec/slice-pat-type-mismatches.stderr
@@ -27,8 +27,6 @@ error[E0282]: type annotations needed
    |
 LL |         [] => {}
    |         ^^ cannot infer type
-   |
-   = note: type must be known at this point
 
 error: aborting due to 5 previous errors
 
diff --git a/src/test/ui/cast/issue-85586.stderr b/src/test/ui/cast/issue-85586.stderr
index 271885a133a..ed8a6fc62e9 100644
--- a/src/test/ui/cast/issue-85586.stderr
+++ b/src/test/ui/cast/issue-85586.stderr
@@ -3,8 +3,6 @@ error[E0282]: type annotations needed
    |
 LL |     let b = (a + 1) as usize;
    |             ^^^^^^^ cannot infer type
-   |
-   = note: type must be known at this point
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/impl-trait/hidden-type-is-opaque-2.stderr b/src/test/ui/impl-trait/hidden-type-is-opaque-2.stderr
index 11ba5aa7867..957052feba9 100644
--- a/src/test/ui/impl-trait/hidden-type-is-opaque-2.stderr
+++ b/src/test/ui/impl-trait/hidden-type-is-opaque-2.stderr
@@ -3,16 +3,12 @@ error[E0282]: type annotations needed
    |
 LL |         cont.reify_as();
    |         ^^^^ cannot infer type
-   |
-   = note: type must be known at this point
 
 error[E0282]: type annotations needed
   --> $DIR/hidden-type-is-opaque-2.rs:18:9
    |
 LL |         cont.reify_as();
    |         ^^^^ cannot infer type
-   |
-   = note: type must be known at this point
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/issues/issue-15965.stderr b/src/test/ui/issues/issue-15965.stderr
index 90377c19dee..fe06810b8df 100644
--- a/src/test/ui/issues/issue-15965.stderr
+++ b/src/test/ui/issues/issue-15965.stderr
@@ -5,8 +5,6 @@ LL | /         { return () }
 LL | |
 LL | |     ()
    | |______^ cannot infer type
-   |
-   = note: type must be known at this point
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-20261.stderr b/src/test/ui/issues/issue-20261.stderr
index 73468c7ca16..9ac751e4dc4 100644
--- a/src/test/ui/issues/issue-20261.stderr
+++ b/src/test/ui/issues/issue-20261.stderr
@@ -3,8 +3,6 @@ error[E0282]: type annotations needed
    |
 LL |         i.clone();
    |           ^^^^^ cannot infer type
-   |
-   = note: type must be known at this point
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-2151.stderr b/src/test/ui/issues/issue-2151.stderr
index e0d946205ad..31a8ca5fbfa 100644
--- a/src/test/ui/issues/issue-2151.stderr
+++ b/src/test/ui/issues/issue-2151.stderr
@@ -3,8 +3,9 @@ error[E0282]: type annotations needed
    |
 LL |     let x = panic!();
    |         ^
+LL |     x.clone();
+   |     - type must be known at this point
    |
-   = note: type must be known at this point
 help: consider giving `x` an explicit type
    |
 LL |     let x: _ = panic!();
diff --git a/src/test/ui/issues/issue-51116.rs b/src/test/ui/issues/issue-51116.rs
index c979c7b2cdd..4c21cbfc61d 100644
--- a/src/test/ui/issues/issue-51116.rs
+++ b/src/test/ui/issues/issue-51116.rs
@@ -5,7 +5,6 @@ fn main() {
             *tile = 0;
             //~^ ERROR type annotations needed
             //~| NOTE cannot infer type
-            //~| NOTE type must be known at this point
         }
     }
 
diff --git a/src/test/ui/issues/issue-51116.stderr b/src/test/ui/issues/issue-51116.stderr
index 399b421ab16..c07f8735eb2 100644
--- a/src/test/ui/issues/issue-51116.stderr
+++ b/src/test/ui/issues/issue-51116.stderr
@@ -3,8 +3,6 @@ error[E0282]: type annotations needed
    |
 LL |             *tile = 0;
    |             ^^^^^ cannot infer type
-   |
-   = note: type must be known at this point
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/pattern/issue-88074-pat-range-type-inference-err.stderr b/src/test/ui/pattern/issue-88074-pat-range-type-inference-err.stderr
index 06a279925ed..8e528f8c1db 100644
--- a/src/test/ui/pattern/issue-88074-pat-range-type-inference-err.stderr
+++ b/src/test/ui/pattern/issue-88074-pat-range-type-inference-err.stderr
@@ -12,8 +12,6 @@ error[E0282]: type annotations needed
    |
 LL |         Zero::ZERO ..= Zero::ZERO => {},
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
-   |
-   = note: type must be known at this point
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/pattern/pat-tuple-bad-type.stderr b/src/test/ui/pattern/pat-tuple-bad-type.stderr
index 11b28987848..3342b8e4002 100644
--- a/src/test/ui/pattern/pat-tuple-bad-type.stderr
+++ b/src/test/ui/pattern/pat-tuple-bad-type.stderr
@@ -3,8 +3,10 @@ error[E0282]: type annotations needed
    |
 LL |     let x;
    |         ^
+...
+LL |         (..) => {}
+   |         ---- type must be known at this point
    |
-   = note: type must be known at this point
 help: consider giving `x` an explicit type
    |
 LL |     let x: _;
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.full.stderr b/src/test/ui/span/issue-42234-unknown-receiver-type.full.stderr
index cd3ffdc6f9d..2b178990850 100644
--- a/src/test/ui/span/issue-42234-unknown-receiver-type.full.stderr
+++ b/src/test/ui/span/issue-42234-unknown-receiver-type.full.stderr
@@ -3,8 +3,9 @@ error[E0282]: type annotations needed
    |
 LL |     let x: Option<_> = None;
    |                        ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
+LL |     x.unwrap().method_that_could_exist_on_some_type();
+   |     ---------- type must be known at this point
    |
-   = note: type must be known at this point
 help: consider specifying the generic argument
    |
 LL |     let x: Option<_> = None::<T>;
@@ -16,7 +17,6 @@ error[E0282]: type annotations needed
 LL |         .sum::<_>()
    |          ^^^ cannot infer type of the type parameter `S` declared on the associated function `sum`
    |
-   = note: type must be known at this point
 help: consider specifying the generic argument
    |
 LL |         .sum::<_>()
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr b/src/test/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr
index b6a3f07f571..d93d54e878b 100644
--- a/src/test/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr
+++ b/src/test/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr
@@ -3,8 +3,9 @@ error[E0282]: type annotations needed
    |
 LL |     let x: Option<_> = None;
    |                        ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
+LL |     x.unwrap().method_that_could_exist_on_some_type();
+   |     ---------- type must be known at this point
    |
-   = note: type must be known at this point
 help: consider specifying the generic argument
    |
 LL |     let x: Option<_> = None::<T>;
@@ -16,7 +17,6 @@ error[E0282]: type annotations needed
 LL |         .sum::<_>()
    |          ^^^ cannot infer type of the type parameter `S` declared on the associated function `sum`
    |
-   = note: type must be known at this point
 help: consider specifying the generic argument
    |
 LL |         .sum::<S>()
diff --git a/src/test/ui/span/method-and-field-eager-resolution.stderr b/src/test/ui/span/method-and-field-eager-resolution.stderr
index 2dd650f38ce..7d240589a3f 100644
--- a/src/test/ui/span/method-and-field-eager-resolution.stderr
+++ b/src/test/ui/span/method-and-field-eager-resolution.stderr
@@ -3,8 +3,10 @@ error[E0282]: type annotations needed
    |
 LL |     let mut x = Default::default();
    |         ^^^^^
+LL |
+LL |     x.0;
+   |     - type must be known at this point
    |
-   = note: type must be known at this point
 help: consider giving `x` an explicit type
    |
 LL |     let mut x: _ = Default::default();
@@ -15,8 +17,10 @@ error[E0282]: type annotations needed
    |
 LL |     let mut x = Default::default();
    |         ^^^^^
+LL |
+LL |     x[0];
+   |     - type must be known at this point
    |
-   = note: type must be known at this point
 help: consider giving `x` an explicit type
    |
 LL |     let mut x: _ = Default::default();
diff --git a/src/test/ui/span/type-annotations-needed-expr.stderr b/src/test/ui/span/type-annotations-needed-expr.stderr
index e4a8f746462..9dff6c64db4 100644
--- a/src/test/ui/span/type-annotations-needed-expr.stderr
+++ b/src/test/ui/span/type-annotations-needed-expr.stderr
@@ -4,7 +4,6 @@ error[E0282]: type annotations needed
 LL |     let _ = (vec![1,2,3]).into_iter().sum() as f64;
    |                                       ^^^ cannot infer type of the type parameter `S` declared on the associated function `sum`
    |
-   = note: type must be known at this point
 help: consider specifying the generic argument
    |
 LL |     let _ = (vec![1,2,3]).into_iter().sum::<S>() as f64;
diff --git a/src/test/ui/type-alias-impl-trait/closures_in_branches.stderr b/src/test/ui/type-alias-impl-trait/closures_in_branches.stderr
index b7a7871143c..08f7d8c9f2d 100644
--- a/src/test/ui/type-alias-impl-trait/closures_in_branches.stderr
+++ b/src/test/ui/type-alias-impl-trait/closures_in_branches.stderr
@@ -14,9 +14,8 @@ error[E0282]: type annotations needed
   --> $DIR/closures_in_branches.rs:21:10
    |
 LL |         |x| x.len()
-   |          ^
+   |          ^  - type must be known at this point
    |
-   = note: type must be known at this point
 help: consider giving this closure parameter an explicit type
    |
 LL |         |x: _| x.len()
diff --git a/src/test/ui/typeck/issue-65611.stderr b/src/test/ui/typeck/issue-65611.stderr
index 5f831291a38..003c630790d 100644
--- a/src/test/ui/typeck/issue-65611.stderr
+++ b/src/test/ui/typeck/issue-65611.stderr
@@ -3,8 +3,6 @@ error[E0282]: type annotations needed
    |
 LL |     let x = buffer.last().unwrap().0.clone();
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `T`
-   |
-   = note: type must be known at this point
 
 error[E0609]: no field `0` on type `&_`
   --> $DIR/issue-65611.rs:59:36
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr
index 666ab79b65c..ff2a597bed0 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr
@@ -3,8 +3,10 @@ error[E0282]: type annotations needed for `Option<T>`
    |
 LL |     let mut closure0 = None;
    |         ^^^^^^^^^^^^
+...
+LL |                         return c();
+   |                                --- type must be known at this point
    |
-   = note: type must be known at this point
 help: consider giving `closure0` an explicit type, where the placeholders `_` are specified
    |
 LL |     let mut closure0: Option<T> = None;