summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closures/2229_closure_analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/closures/2229_closure_analysis')
-rw-r--r--src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr10
-rw-r--r--src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr10
-rw-r--r--src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr8
-rw-r--r--src/test/ui/closures/2229_closure_analysis/repr_packed.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs4
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr16
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs4
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs2
12 files changed, 40 insertions, 24 deletions
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs
index 93131b2ac..f97e60daf 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs
@@ -68,7 +68,7 @@ fn arrays_5() {
arr[1] += 10;
};
- // c will capture `arr` completely, therefore we cannot borrow other indecies
+ // c will capture `arr` completely, therefore we cannot borrow other indices
// into the array.
println!("{:#?}", &arr[3..2]);
//~^ ERROR: cannot borrow `arr` as immutable because it is also borrowed as mutable
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr
index bcde35983..309c63e52 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr
@@ -7,7 +7,15 @@ LL | let [_, _s] = s;
| - closure is `FnOnce` because it moves the variable `s` out of its environment
LL | };
LL | expect_fn(c);
- | --------- the requirement to implement `Fn` derives from here
+ | --------- - the requirement to implement `Fn` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `expect_fn`
+ --> $DIR/closure-origin-array-diagnostics.rs:5:17
+ |
+LL | fn expect_fn<F: Fn()>(_f: F) {}
+ | ^^^^ required by this bound in `expect_fn`
error: aborting due to previous error
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr
index df33c4f1f..3e77635f9 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr
@@ -7,7 +7,15 @@ LL | let s = s.1;
| --- closure is `FnOnce` because it moves the variable `s.1` out of its environment
LL | };
LL | expect_fn(c);
- | --------- the requirement to implement `Fn` derives from here
+ | --------- - the requirement to implement `Fn` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `expect_fn`
+ --> $DIR/closure-origin-tuple-diagnostics.rs:5:17
+ |
+LL | fn expect_fn<F: Fn()>(_f: F) {}
+ | ^^^^ required by this bound in `expect_fn`
error: aborting due to previous error
diff --git a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs
index 318673ef8..972c24c23 100644
--- a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs
+++ b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs
@@ -24,7 +24,7 @@ fn main() {
let _a = || { match l1 { L1::A => (), L1::B => () } };
// (except if the match is already non-exhaustive)
let _b = || { match l1 { L1::A => () } };
- //~^ ERROR: non-exhaustive patterns: `B` not covered [E0004]
+ //~^ ERROR: non-exhaustive patterns: `L1::B` not covered [E0004]
// l2 should not be captured as it is a non-exhaustive SingleVariant
// defined in this crate
diff --git a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr
index e0678bc71..3a5fad154 100644
--- a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `B` not covered
+error[E0004]: non-exhaustive patterns: `L1::B` not covered
--> $DIR/non-exhaustive-match.rs:26:25
|
LL | let _b = || { match l1 { L1::A => () } };
- | ^^ pattern `B` not covered
+ | ^^ pattern `L1::B` not covered
|
note: `L1` defined here
--> $DIR/non-exhaustive-match.rs:12:14
@@ -12,8 +12,8 @@ LL | enum L1 { A, B }
= note: the matched value is of type `L1`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
-LL | let _b = || { match l1 { L1::A => (), B => todo!() } };
- | ++++++++++++++
+LL | let _b = || { match l1 { L1::A => (), L1::B => todo!() } };
+ | ++++++++++++++++++
error[E0004]: non-exhaustive patterns: type `E1` is non-empty
--> $DIR/non-exhaustive-match.rs:37:25
diff --git a/src/test/ui/closures/2229_closure_analysis/repr_packed.rs b/src/test/ui/closures/2229_closure_analysis/repr_packed.rs
index 3ed780f51..f23670f63 100644
--- a/src/test/ui/closures/2229_closure_analysis/repr_packed.rs
+++ b/src/test/ui/closures/2229_closure_analysis/repr_packed.rs
@@ -31,7 +31,7 @@ fn test_alignment_not_affected() {
c();
}
-// `String`, `u16` are not aligned at a one byte boundry and are thus affected by repr(packed).
+// `String`, `u16` are not aligned at a one byte boundary and are thus affected by repr(packed).
//
// Here we test that the closure doesn't capture a reference point to `foo.x` but
// rather capture `foo` entirely.
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs
index 2c828aed5..f8752fe1c 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs
@@ -1,8 +1,8 @@
// edition:2021
// run-pass
-// Test that ByValue captures compile sucessefully especially when the captures are
-// derefenced within the closure.
+// Test that ByValue captures compile successfully especially when the captures are
+// dereferenced within the closure.
#[derive(Debug, Default)]
struct SomeLargeType;
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr
index 40274c883..cf8bd7a0a 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr
@@ -1,8 +1,8 @@
-warning: unused variable: `t2`
- --> $DIR/destructure-pattern-closure-within-closure.rs:13:21
+warning: unused variable: `g2`
+ --> $DIR/destructure-pattern-closure-within-closure.rs:10:17
|
-LL | let (_, t2) = t;
- | ^^ help: if this is intentional, prefix it with an underscore: `_t2`
+LL | let (_, g2) = g;
+ | ^^ help: if this is intentional, prefix it with an underscore: `_g2`
|
note: the lint level is defined here
--> $DIR/destructure-pattern-closure-within-closure.rs:3:9
@@ -11,11 +11,11 @@ LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
-warning: unused variable: `g2`
- --> $DIR/destructure-pattern-closure-within-closure.rs:10:17
+warning: unused variable: `t2`
+ --> $DIR/destructure-pattern-closure-within-closure.rs:13:21
|
-LL | let (_, g2) = g;
- | ^^ help: if this is intentional, prefix it with an underscore: `_g2`
+LL | let (_, t2) = t;
+ | ^^ help: if this is intentional, prefix it with an underscore: `_t2`
warning: 2 warnings emitted
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs
index 88a9816a0..03400e0ee 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs
@@ -1,7 +1,7 @@
// edition:2021
// run-pass
-// Tests that if a closure uses indivual fields of the same object
+// Tests that if a closure uses individual fields of the same object
// then that case is handled properly.
#![allow(unused)]
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs
index b8e464031..624e0ff22 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs
@@ -1,10 +1,10 @@
// edition:2021
// run-pass
-// Test that closures can catpure paths that are more precise than just one level
+// Test that closures can capture paths that are more precise than just one level
// from the root variable.
//
-// If the closures can handle such precison we should be able to mutate one path in the closure
+// If the closures can handle such precision we should be able to mutate one path in the closure
// while being able to mutate another path outside the closure, where the two paths are disjoint
// after applying two projections on the root variable.
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs
index 11a324d8a..bd8addd37 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs
@@ -3,7 +3,7 @@
#![allow(unused)]
-// If the closures can handle such precison we should be able to read one path in the closure
+// If the closures can handle such precision we should be able to read one path in the closure
// while being able mutate another path outside the closure, where the two paths are disjoint
// after applying two projections on the root variable.
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs
index bb784774b..a85335438 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs
@@ -5,7 +5,7 @@
// that is captured by the closure
// More specifically we test that the if the mutable reference isn't root variable of a capture
-// but rather accessed while acessing the precise capture.
+// but rather accessed while accessing the precise capture.
fn mut_tuple() {
let mut t = (10, 10);