Skip to content
Permalink
Browse files

Add new folder for destructuring assignment tests

  • Loading branch information
varkor committed Dec 22, 2019
1 parent 35979a9 commit 9a602243c422f183f574ff53e5d3e9e85fcc1210
@@ -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.
///
@@ -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",
);
@@ -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.
///
@@ -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
File renamed without changes.
@@ -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

0 comments on commit 9a60224

Please sign in to comment.
You can’t perform that action at this time.