Add new folder for destructuring assignment tests

This commit is contained in:
varkor 2019-12-22 23:09:54 +00:00
parent 35979a92bf
commit 9a602243c4
6 changed files with 23 additions and 21 deletions

View File

@ -1628,6 +1628,7 @@ pub enum ExprKind {
Block(P<Block>, Option<Label>),
/// An assignment (e.g., `a = foo()`).
/// The `Span` argument is the span of the `=` token.
Assign(P<Expr>, P<Expr>, Span),
/// An assignment with an operator.
///

View File

@ -751,7 +751,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
);
err.span_label(lhs.span, "cannot assign to this expression");
if self.is_destructuring_place_expr(lhs) {
err.note("destructuring assignments are not yet supported");
err.note("destructuring assignments are not currently supported");
err.note(
"for more information, see https://github.com/rust-lang/rfcs/issues/372",
);

View File

@ -1216,6 +1216,7 @@ pub enum ExprKind {
TryBlock(P<Block>),
/// An assignment (`a = foo()`).
/// The `Span` argument is the span of the `=` token.
Assign(P<Expr>, P<Expr>, Span),
/// An assignment with an operator.
///

View File

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

View File

@ -1,16 +1,16 @@
error[E0070]: invalid left-hand side of assignment
--> $DIR/destructuring-assignment.rs:6:12
--> $DIR/note-unsupported.rs:6:12
|
LL | (a, b) = (3, 4);
| ------ ^
| |
| cannot assign to this expression
|
= note: destructuring assignments are not yet supported
= note: destructuring assignments are not currently supported
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
error[E0368]: binary assignment operation `+=` cannot be applied to type `({integer}, {integer})`
--> $DIR/destructuring-assignment.rs:7:5
--> $DIR/note-unsupported.rs:7:5
|
LL | (a, b) += (3, 4);
| ------^^^^^^^^^^
@ -20,29 +20,29 @@ LL | (a, b) += (3, 4);
= note: an implementation of `std::ops::AddAssign` might be missing for `({integer}, {integer})`
error[E0067]: invalid left-hand side of assignment
--> $DIR/destructuring-assignment.rs:7:12
--> $DIR/note-unsupported.rs:7:12
|
LL | (a, b) += (3, 4);
| ------ ^^
| |
| cannot assign to this expression
|
= note: destructuring assignments are not yet supported
= note: destructuring assignments are not currently supported
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
error[E0070]: invalid left-hand side of assignment
--> $DIR/destructuring-assignment.rs:10:12
--> $DIR/note-unsupported.rs:10:12
|
LL | [a, b] = [3, 4];
| ------ ^
| |
| cannot assign to this expression
|
= note: destructuring assignments are not yet supported
= note: destructuring assignments are not currently supported
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
error[E0368]: binary assignment operation `+=` cannot be applied to type `[{integer}; 2]`
--> $DIR/destructuring-assignment.rs:11:5
--> $DIR/note-unsupported.rs:11:5
|
LL | [a, b] += [3, 4];
| ------^^^^^^^^^^
@ -52,29 +52,29 @@ LL | [a, b] += [3, 4];
= note: an implementation of `std::ops::AddAssign` might be missing for `[{integer}; 2]`
error[E0067]: invalid left-hand side of assignment
--> $DIR/destructuring-assignment.rs:11:12
--> $DIR/note-unsupported.rs:11:12
|
LL | [a, b] += [3, 4];
| ------ ^^
| |
| cannot assign to this expression
|
= note: destructuring assignments are not yet supported
= note: destructuring assignments are not currently supported
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
error[E0070]: invalid left-hand side of assignment
--> $DIR/destructuring-assignment.rs:16:22
--> $DIR/note-unsupported.rs:16:22
|
LL | S { x: a, y: b } = s;
| ---------------- ^
| |
| cannot assign to this expression
|
= note: destructuring assignments are not yet supported
= note: destructuring assignments are not currently supported
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
error[E0368]: binary assignment operation `+=` cannot be applied to type `S`
--> $DIR/destructuring-assignment.rs:17:5
--> $DIR/note-unsupported.rs:17:5
|
LL | S { x: a, y: b } += s;
| ----------------^^^^^
@ -84,36 +84,36 @@ LL | S { x: a, y: b } += s;
= note: an implementation of `std::ops::AddAssign` might be missing for `S`
error[E0067]: invalid left-hand side of assignment
--> $DIR/destructuring-assignment.rs:17:22
--> $DIR/note-unsupported.rs:17:22
|
LL | S { x: a, y: b } += s;
| ---------------- ^^
| |
| cannot assign to this expression
|
= note: destructuring assignments are not yet supported
= note: destructuring assignments are not currently supported
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
error[E0070]: invalid left-hand side of assignment
--> $DIR/destructuring-assignment.rs:20:21
--> $DIR/note-unsupported.rs:20:21
|
LL | S { x: a, ..s } = S { x: 3, y: 4 };
| --------------- ^
| |
| cannot assign to this expression
|
= note: destructuring assignments are not yet supported
= note: destructuring assignments are not currently supported
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
error[E0070]: invalid left-hand side of assignment
--> $DIR/destructuring-assignment.rs:24:17
--> $DIR/note-unsupported.rs:24:17
|
LL | ((a, b), c) = ((3, 4), 5);
| ----------- ^
| |
| cannot assign to this expression
|
= note: destructuring assignments are not yet supported
= note: destructuring assignments are not currently supported
= note: for more information, see https://github.com/rust-lang/rfcs/issues/372
error: aborting due to 11 previous errors