about summary refs log tree commit diff
path: root/src/test/ui/parser/mut-patterns.rs
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/ui/parser/mut-patterns.rs
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'src/test/ui/parser/mut-patterns.rs')
-rw-r--r--src/test/ui/parser/mut-patterns.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/test/ui/parser/mut-patterns.rs b/src/test/ui/parser/mut-patterns.rs
deleted file mode 100644
index 8b83d6ab2f8..00000000000
--- a/src/test/ui/parser/mut-patterns.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-// Can't put mut in non-ident pattern
-
-// edition:2018
-
-#![feature(box_patterns)]
-#![allow(warnings)]
-
-pub fn main() {
-    let mut _ = 0; //~ ERROR `mut` must be followed by a named binding
-    let mut (_, _) = (0, 0); //~ ERROR `mut` must be followed by a named binding
-
-    let mut (x @ y) = 0; //~ ERROR `mut` must be attached to each individual binding
-
-    let mut mut x = 0;
-    //~^ ERROR `mut` on a binding may not be repeated
-    //~| remove the additional `mut`s
-
-    struct Foo { x: isize }
-    let mut Foo { x: x } = Foo { x: 3 };
-    //~^ ERROR `mut` must be attached to each individual binding
-    //~| add `mut` to each binding
-
-    let mut Foo { x } = Foo { x: 3 };
-    //~^ ERROR `mut` must be attached to each individual binding
-    //~| add `mut` to each binding
-
-    struct r#yield(u8, u8);
-    let mut mut yield(become, await) = r#yield(0, 0);
-    //~^ ERROR `mut` on a binding may not be repeated
-    //~| ERROR `mut` must be attached to each individual binding
-    //~| ERROR expected identifier, found reserved keyword `yield`
-    //~| ERROR expected identifier, found reserved keyword `become`
-    //~| ERROR expected identifier, found keyword `await`
-
-    struct W<T, U>(T, U);
-    struct B { f: Box<u8> }
-    let mut W(mut a, W(b, W(ref c, W(d, B { box f }))))
-    //~^ ERROR `mut` must be attached to each individual binding
-        = W(0, W(1, W(2, W(3, B { f: Box::new(4u8) }))));
-
-    // Make sure we don't accidentally allow `mut $p` where `$p:pat`.
-    macro_rules! foo {
-        ($p:pat) => {
-            let mut $p = 0; //~ ERROR expected identifier, found `x`
-        }
-    }
-    foo!(x);
-}