diff options
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/borrowck/return-local-binding-from-desugaring.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/borrowck/return-local-binding-from-desugaring.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/for/for-loop-unconstrained-element-type.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-20261.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-33941.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-33941.stderr | 12 | ||||
| -rw-r--r-- | src/test/ui/nll/dont-print-desugared.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/nll/issue-53773.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/reachable/unreachable-loop-patterns.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/reachable/unreachable-loop-patterns.stderr | 8 |
10 files changed, 13 insertions, 31 deletions
diff --git a/src/test/ui/borrowck/return-local-binding-from-desugaring.rs b/src/test/ui/borrowck/return-local-binding-from-desugaring.rs index b2dcd54ec2e..c6643edf5a9 100644 --- a/src/test/ui/borrowck/return-local-binding-from-desugaring.rs +++ b/src/test/ui/borrowck/return-local-binding-from-desugaring.rs @@ -27,7 +27,7 @@ where let key = f(x); result.entry(key).or_insert(Vec::new()).push(x); } - result //~ ERROR cannot return value referencing local binding + result //~ ERROR cannot return value referencing temporary value } fn main() {} diff --git a/src/test/ui/borrowck/return-local-binding-from-desugaring.stderr b/src/test/ui/borrowck/return-local-binding-from-desugaring.stderr index 293dbe62813..9f952542e18 100644 --- a/src/test/ui/borrowck/return-local-binding-from-desugaring.stderr +++ b/src/test/ui/borrowck/return-local-binding-from-desugaring.stderr @@ -1,8 +1,8 @@ -error[E0515]: cannot return value referencing local binding +error[E0515]: cannot return value referencing temporary value --> $DIR/return-local-binding-from-desugaring.rs:30:5 | LL | for ref x in xs { - | -- local binding introduced here + | -- temporary value created here ... LL | result | ^^^^^^ returns a value referencing data owned by the current function diff --git a/src/test/ui/for/for-loop-unconstrained-element-type.stderr b/src/test/ui/for/for-loop-unconstrained-element-type.stderr index 0672014a929..580b135ac2d 100644 --- a/src/test/ui/for/for-loop-unconstrained-element-type.stderr +++ b/src/test/ui/for/for-loop-unconstrained-element-type.stderr @@ -1,8 +1,10 @@ error[E0282]: type annotations needed - --> $DIR/for-loop-unconstrained-element-type.rs:8:14 + --> $DIR/for-loop-unconstrained-element-type.rs:8:9 | LL | for i in Vec::new() { } - | ^^^^^^^^^^ the element type for this iterator is not specified + | ^ ---------- the element type for this iterator is not specified + | | + | cannot infer type 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 c6c3f32dfe7..6330364c92b 100644 --- a/src/test/ui/issues/issue-20261.stderr +++ b/src/test/ui/issues/issue-20261.stderr @@ -1,8 +1,8 @@ -error[E0282]: type annotations needed for `&(_,)` +error[E0282]: type annotations needed for `(_,)` --> $DIR/issue-20261.rs:4:11 | LL | for (ref i,) in [].iter() { - | --------- the element type for this iterator is not specified + | --------- this method call resolves to `std::slice::Iter<'_, T>` LL | i.clone(); | ^^^^^ cannot infer type | diff --git a/src/test/ui/issues/issue-33941.rs b/src/test/ui/issues/issue-33941.rs index 4fb805b37e0..ccaa6334856 100644 --- a/src/test/ui/issues/issue-33941.rs +++ b/src/test/ui/issues/issue-33941.rs @@ -3,5 +3,4 @@ use std::collections::HashMap; fn main() { for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch //~^ ERROR type mismatch - //~| ERROR type mismatch } diff --git a/src/test/ui/issues/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr index e7263148205..eb98a3a29a6 100644 --- a/src/test/ui/issues/issue-33941.stderr +++ b/src/test/ui/issues/issue-33941.stderr @@ -23,16 +23,6 @@ LL | for _ in HashMap::new().iter().cloned() {} = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` = note: required because of the requirements on the impl of `IntoIterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` -error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_` - --> $DIR/issue-33941.rs:4:14 - | -LL | for _ in HashMap::new().iter().cloned() {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found tuple - | - = note: expected reference `&_` - found tuple `(&_, &_)` - = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/nll/dont-print-desugared.stderr b/src/test/ui/nll/dont-print-desugared.stderr index 88773def8b7..fad6121cbca 100644 --- a/src/test/ui/nll/dont-print-desugared.stderr +++ b/src/test/ui/nll/dont-print-desugared.stderr @@ -2,7 +2,7 @@ error[E0596]: cannot borrow data in a `&` reference as mutable --> $DIR/dont-print-desugared.rs:4:10 | LL | for &ref mut x in s {} - | ^^^^^^^^^ cannot borrow as mutable through `&` reference + | ^^^^^^^^^ cannot borrow as mutable error[E0597]: `y` does not live long enough --> $DIR/dont-print-desugared.rs:17:16 diff --git a/src/test/ui/nll/issue-53773.stderr b/src/test/ui/nll/issue-53773.stderr index 11cd423295a..90cba2a145f 100644 --- a/src/test/ui/nll/issue-53773.stderr +++ b/src/test/ui/nll/issue-53773.stderr @@ -2,12 +2,10 @@ error[E0713]: borrow may still be in use when destructor runs --> $DIR/issue-53773.rs:41:22 | LL | members.push(child.raw); - | ^^^^^^^^^ + | -------------^^^^^^^^^- borrow later used here LL | LL | } | - here, drop of `child` needs exclusive access to `*child.raw`, because the type `C<'_>` implements the `Drop` trait -LL | members.len(); - | ------------- borrow later used here | = note: consider using a `let` binding to create a longer lived value diff --git a/src/test/ui/reachable/unreachable-loop-patterns.rs b/src/test/ui/reachable/unreachable-loop-patterns.rs index 4de29c3c3d7..e9cef5f47d4 100644 --- a/src/test/ui/reachable/unreachable-loop-patterns.rs +++ b/src/test/ui/reachable/unreachable-loop-patterns.rs @@ -17,5 +17,4 @@ impl Iterator for Void { fn main() { for _ in unimplemented!() as Void {} //~^ ERROR unreachable pattern - //~^^ ERROR unreachable pattern } diff --git a/src/test/ui/reachable/unreachable-loop-patterns.stderr b/src/test/ui/reachable/unreachable-loop-patterns.stderr index 680d22862d7..80ffa5d73f0 100644 --- a/src/test/ui/reachable/unreachable-loop-patterns.stderr +++ b/src/test/ui/reachable/unreachable-loop-patterns.stderr @@ -10,11 +10,5 @@ note: the lint level is defined here LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ -error: unreachable pattern - --> $DIR/unreachable-loop-patterns.rs:18:14 - | -LL | for _ in unimplemented!() as Void {} - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to previous error |
