Skip to content

Commit 770725c

Browse files
committed
Add new folder for destructuring assignment tests
1 parent ddd4500 commit 770725c

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

src/librustc/hir/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,7 @@ pub enum ExprKind {
16591659
Block(P<Block>, Option<Label>),
16601660

16611661
/// An assignment (e.g., `a = foo()`).
1662+
/// The `Span` argument is the span of the `=` token.
16621663
Assign(P<Expr>, P<Expr>, Span),
16631664
/// An assignment with an operator.
16641665
///

src/librustc_typeck/check/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
788788
);
789789
err.span_label(lhs.span, "cannot assign to this expression");
790790
if self.is_destructuring_place_expr(lhs) {
791-
err.note("destructuring assignments are not yet supported");
791+
err.note("destructuring assignments are not currently supported");
792792
err.note(
793793
"for more information, see https://github.com/rust-lang/rfcs/issues/372",
794794
);

src/libsyntax/ast.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,7 @@ pub enum ExprKind {
12281228
TryBlock(P<Block>),
12291229

12301230
/// An assignment (`a = foo()`).
1231+
/// The `Span` argument is the span of the `=` token.
12311232
Assign(P<Expr>, P<Expr>, Span),
12321233
/// An assignment with an operator.
12331234
///

src/test/ui/bad/bad-expr-lhs.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ LL | (a, b) = (3, 4);
3030
| |
3131
| cannot assign to this expression
3232
|
33-
= note: destructuring assignments are not yet supported
33+
= note: destructuring assignments are not currently supported
3434
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
3535

3636
error[E0070]: invalid left-hand side of assignment

src/test/ui/bad/destructuring-assignment.stderr renamed to src/test/ui/destructuring-assignment/note-unsupported.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | (a, b) = (3, 4);
66
| |
77
| cannot assign to this expression
88
|
9-
= note: destructuring assignments are not yet supported
9+
= note: destructuring assignments are not currently supported
1010
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
1111

1212
error[E0368]: binary assignment operation `+=` cannot be applied to type `({integer}, {integer})`
@@ -27,7 +27,7 @@ LL | (a, b) += (3, 4);
2727
| |
2828
| cannot assign to this expression
2929
|
30-
= note: destructuring assignments are not yet supported
30+
= note: destructuring assignments are not currently supported
3131
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
3232

3333
error[E0070]: invalid left-hand side of assignment
@@ -38,7 +38,7 @@ LL | [a, b] = [3, 4];
3838
| |
3939
| cannot assign to this expression
4040
|
41-
= note: destructuring assignments are not yet supported
41+
= note: destructuring assignments are not currently supported
4242
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
4343

4444
error[E0368]: binary assignment operation `+=` cannot be applied to type `[{integer}; 2]`
@@ -59,7 +59,7 @@ LL | [a, b] += [3, 4];
5959
| |
6060
| cannot assign to this expression
6161
|
62-
= note: destructuring assignments are not yet supported
62+
= note: destructuring assignments are not currently supported
6363
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
6464

6565
error[E0070]: invalid left-hand side of assignment
@@ -70,7 +70,7 @@ LL | S { x: a, y: b } = s;
7070
| |
7171
| cannot assign to this expression
7272
|
73-
= note: destructuring assignments are not yet supported
73+
= note: destructuring assignments are not currently supported
7474
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
7575

7676
error[E0368]: binary assignment operation `+=` cannot be applied to type `S`
@@ -91,7 +91,7 @@ LL | S { x: a, y: b } += s;
9191
| |
9292
| cannot assign to this expression
9393
|
94-
= note: destructuring assignments are not yet supported
94+
= note: destructuring assignments are not currently supported
9595
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
9696

9797
error[E0070]: invalid left-hand side of assignment
@@ -102,7 +102,7 @@ LL | S { x: a, ..s } = S { x: 3, y: 4 };
102102
| |
103103
| cannot assign to this expression
104104
|
105-
= note: destructuring assignments are not yet supported
105+
= note: destructuring assignments are not currently supported
106106
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
107107

108108
error[E0070]: invalid left-hand side of assignment
@@ -113,7 +113,7 @@ LL | ((a, b), c) = ((3, 4), 5);
113113
| |
114114
| cannot assign to this expression
115115
|
116-
= note: destructuring assignments are not yet supported
116+
= note: destructuring assignments are not currently supported
117117
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
118118

119119
error: aborting due to 11 previous errors

0 commit comments

Comments
 (0)