diff options
| author | Dan Aloni <alonid@gmail.com> | 2020-09-02 10:40:56 +0300 |
|---|---|---|
| committer | Dan Aloni <alonid@gmail.com> | 2020-09-02 22:26:37 +0300 |
| commit | 07e7823c01be1733df2480de19fbbe6b8e9384cf (patch) | |
| tree | 9e4ff1075680201f9c72b58bf780638ef1fcede3 /src/test/ui/pattern | |
| parent | 7b2deb562822112cc30d23958e7459564e2c6ef9 (diff) | |
| download | rust-07e7823c01be1733df2480de19fbbe6b8e9384cf.tar.gz rust-07e7823c01be1733df2480de19fbbe6b8e9384cf.zip | |
pretty: trim paths of unique symbols
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
Diffstat (limited to 'src/test/ui/pattern')
24 files changed, 132 insertions, 132 deletions
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr index 56613ee7618..d28edd11e12 100644 --- a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr +++ b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr @@ -2,7 +2,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-move-and-move.rs:14:13 | LL | let a @ b = U; - | ----^ - move occurs because value has type `main::U`, which does not implement the `Copy` trait + | ----^ - move occurs because value has type `U`, which does not implement the `Copy` trait | | | | | value used here after move | value moved here @@ -11,7 +11,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-move-and-move.rs:16:17 | LL | let a @ (b, c) = (U, U); - | --------^- ------ move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait + | --------^- ------ move occurs because value has type `(U, U)`, which does not implement the `Copy` trait | | | | | value used here after move | value moved here @@ -20,7 +20,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-move-and-move.rs:18:17 | LL | let a @ (b, c) = (u(), u()); - | --------^- ---------- move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait + | --------^- ---------- move occurs because value has type `(U, U)`, which does not implement the `Copy` trait | | | | | value used here after move | value moved here @@ -29,7 +29,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-move-and-move.rs:21:16 | LL | match Ok(U) { - | ----- move occurs because value has type `std::result::Result<main::U, main::U>`, which does not implement the `Copy` trait + | ----- move occurs because value has type `std::result::Result<U, U>`, which does not implement the `Copy` trait LL | a @ Ok(b) | a @ Err(b) => {} | -------^- | | | @@ -40,7 +40,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-move-and-move.rs:21:29 | LL | match Ok(U) { - | ----- move occurs because value has type `std::result::Result<main::U, main::U>`, which does not implement the `Copy` trait + | ----- move occurs because value has type `std::result::Result<U, U>`, which does not implement the `Copy` trait LL | a @ Ok(b) | a @ Err(b) => {} | --------^- | | | @@ -51,7 +51,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-move-and-move.rs:28:22 | LL | match [u(), u(), u(), u()] { - | -------------------- move occurs because value has type `[main::U; 4]`, which does not implement the `Copy` trait + | -------------------- move occurs because value has type `[U; 4]`, which does not implement the `Copy` trait LL | xs @ [a, .., b] => {} | -------------^- | | | @@ -62,7 +62,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-move-and-move.rs:32:18 | LL | match [u(), u(), u(), u()] { - | -------------------- move occurs because value has type `[main::U; 4]`, which does not implement the `Copy` trait + | -------------------- move occurs because value has type `[U; 4]`, which does not implement the `Copy` trait LL | xs @ [_, ys @ .., _] => {} | ---------^^^^^^^---- | | | @@ -77,7 +77,7 @@ LL | fn fun(a @ b: U) {} | | | | | value used here after move | value moved here - | move occurs because value has type `main::U`, which does not implement the `Copy` trait + | move occurs because value has type `U`, which does not implement the `Copy` trait error: aborting due to 8 previous errors diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr index 5ce546f08bf..44888369ab2 100644 --- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr +++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr @@ -74,7 +74,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-pat-at-and-box.rs:21:18 | LL | let a @ box &b = Box::new(&C); - | ---------^ ------------ move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait + | ---------^ ------------ move occurs because value has type `Box<&C>`, which does not implement the `Copy` trait | | | | | value used here after move | value moved here @@ -83,7 +83,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-pat-at-and-box.rs:24:17 | LL | let a @ box b = Box::new(C); - | --------^ ----------- move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait + | --------^ ----------- move occurs because value has type `Box<C>`, which does not implement the `Copy` trait | | | | | value used here after move | value moved here @@ -92,7 +92,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-pat-at-and-box.rs:34:17 | LL | match Box::new(C) { - | ----------- move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait + | ----------- move occurs because value has type `Box<C>`, which does not implement the `Copy` trait LL | a @ box b => {} | --------^ | | | @@ -143,7 +143,7 @@ LL | fn f1(a @ box &b: Box<&C>) {} | | | | | value used here after move | value moved here - | move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait + | move occurs because value has type `Box<&C>`, which does not implement the `Copy` trait error[E0382]: use of moved value --> $DIR/borrowck-pat-at-and-box.rs:30:19 @@ -153,7 +153,7 @@ LL | fn f2(a @ box b: Box<C>) {} | | | | | value used here after move | value moved here - | move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait + | move occurs because value has type `Box<C>`, which does not implement the `Copy` trait error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable --> $DIR/borrowck-pat-at-and-box.rs:58:27 diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr index 54900e958c2..dacf23f9ded 100644 --- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr +++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr @@ -6,7 +6,7 @@ LL | let a @ ref b = U; | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `main::U` which does not implement the `Copy` trait + | move occurs because `a` has type `U` which does not implement the `Copy` trait error: aborting due to previous error diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr index 5058998f2a7..86e09e55585 100644 --- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr +++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr @@ -6,7 +6,7 @@ LL | let a @ ref b = U; | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `main::U` which does not implement the `Copy` trait + | move occurs because `a` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:9 @@ -17,7 +17,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U); | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `(main::U, main::U)` which does not implement the `Copy` trait + | move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:14 @@ -27,7 +27,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U); | | | | | value borrowed here after move | value moved into `b` here - | move occurs because `b` has type `main::U` which does not implement the `Copy` trait + | move occurs because `b` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:33 @@ -37,7 +37,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U); | | | | | value borrowed here after move | value moved into `d` here - | move occurs because `d` has type `main::U` which does not implement the `Copy` trait + | move occurs because `d` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:38:9 @@ -48,7 +48,7 @@ LL | let a @ [ref mut b, ref c] = [U, U]; | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `[main::U; 2]` which does not implement the `Copy` trait + | move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:41:9 @@ -58,7 +58,7 @@ LL | let a @ ref b = u(); | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `main::U` which does not implement the `Copy` trait + | move occurs because `a` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:44:9 @@ -69,7 +69,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `(main::U, main::U)` which does not implement the `Copy` trait + | move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:44:14 @@ -79,7 +79,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); | | | | | value borrowed here after move | value moved into `b` here - | move occurs because `b` has type `main::U` which does not implement the `Copy` trait + | move occurs because `b` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:44:33 @@ -89,7 +89,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); | | | | | value borrowed here after move | value moved into `d` here - | move occurs because `d` has type `main::U` which does not implement the `Copy` trait + | move occurs because `d` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:51:9 @@ -100,7 +100,7 @@ LL | let a @ [ref mut b, ref c] = [u(), u()]; | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `[main::U; 2]` which does not implement the `Copy` trait + | move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:56:9 @@ -110,7 +110,7 @@ LL | a @ Some(ref b) => {} | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `std::option::Option<main::U>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:9 @@ -121,7 +121,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `std::option::Option<(main::U, main::U)>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:19 @@ -131,7 +131,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | | | | value borrowed here after move | value moved into `b` here - | move occurs because `b` has type `main::U` which does not implement the `Copy` trait + | move occurs because `b` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:38 @@ -141,7 +141,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | | | | value borrowed here after move | value moved into `d` here - | move occurs because `d` has type `main::U` which does not implement the `Copy` trait + | move occurs because `d` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:71:9 @@ -152,7 +152,7 @@ LL | mut a @ Some([ref b, ref mut c]) => {} | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `std::option::Option<[main::U; 2]>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:77:9 @@ -162,7 +162,7 @@ LL | a @ Some(ref b) => {} | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `std::option::Option<main::U>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:83:9 @@ -173,7 +173,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `std::option::Option<(main::U, main::U)>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:83:19 @@ -183,7 +183,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | | | | value borrowed here after move | value moved into `b` here - | move occurs because `b` has type `main::U` which does not implement the `Copy` trait + | move occurs because `b` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:83:38 @@ -193,7 +193,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | | | | value borrowed here after move | value moved into `d` here - | move occurs because `d` has type `main::U` which does not implement the `Copy` trait + | move occurs because `d` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:93:9 @@ -204,7 +204,7 @@ LL | mut a @ Some([ref b, ref mut c]) => {} | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `std::option::Option<[main::U; 2]>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:14:11 @@ -214,7 +214,7 @@ LL | fn f1(a @ ref b: U) {} | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `main::U` which does not implement the `Copy` trait + | move occurs because `a` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:18:11 @@ -225,7 +225,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `(main::U, main::U)` which does not implement the `Copy` trait + | move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:18:20 @@ -235,7 +235,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} | | | | | value borrowed here after move | value moved into `b` here - | move occurs because `b` has type `main::U` which does not implement the `Copy` trait + | move occurs because `b` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:18:31 @@ -245,7 +245,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} | | | | | value borrowed here after move | value moved into `d` here - | move occurs because `d` has type `main::U` which does not implement the `Copy` trait + | move occurs because `d` has type `U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:25:11 @@ -256,7 +256,7 @@ LL | fn f3(a @ [ref mut b, ref c]: [U; 2]) {} | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `[main::U; 2]` which does not implement the `Copy` trait + | move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:22 @@ -267,13 +267,13 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U); | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait error[E0382]: use of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:33 | LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U); - | ------------------------^^^^^^^^^- ------ move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait + | ------------------------^^^^^^^^^- ------ move occurs because value has type `(U, U)`, which does not implement the `Copy` trait | | | | | value used here after move | value moved here @@ -287,13 +287,13 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U); | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:38:25 | LL | let a @ [ref mut b, ref c] = [U, U]; - | ----------------^^^^^- ------ move occurs because value has type `[main::U; 2]`, which does not implement the `Copy` trait + | ----------------^^^^^- ------ move occurs because value has type `[U; 2]`, which does not implement the `Copy` trait | | | | | value borrowed here after move | value moved here @@ -302,7 +302,7 @@ error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:41:13 | LL | let a @ ref b = u(); - | ----^^^^^ --- move occurs because value has type `main::U`, which does not implement the `Copy` trait + | ----^^^^^ --- move occurs because value has type `U`, which does not implement the `Copy` trait | | | | | value borrowed here after move | value moved here @@ -316,13 +316,13 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait error[E0382]: use of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:44:33 | LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); - | ------------------------^^^^^^^^^- ---------- move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait + | ------------------------^^^^^^^^^- ---------- move occurs because value has type `(U, U)`, which does not implement the `Copy` trait | | | | | value used here after move | value moved here @@ -336,13 +336,13 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:51:25 | LL | let a @ [ref mut b, ref c] = [u(), u()]; - | ----------------^^^^^- ---------- move occurs because value has type `[main::U; 2]`, which does not implement the `Copy` trait + | ----------------^^^^^- ---------- move occurs because value has type `[U; 2]`, which does not implement the `Copy` trait | | | | | value borrowed here after move | value moved here @@ -356,7 +356,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait help: borrow this field in the pattern to avoid moving the value | LL | a @ Some((ref mut b @ ref mut c, d @ ref e)) => {} @@ -366,7 +366,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:38 | LL | match Some((U, U)) { - | ------------ move occurs because value has type `std::option::Option<(main::U, main::U)>`, which does not implement the `Copy` trait + | ------------ move occurs because value has type `Option<(U, U)>`, which does not implement the `Copy` trait LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | -----------------------------^^^^^^^^^-- | | | @@ -382,7 +382,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait help: borrow this field in the pattern to avoid moving the value | LL | a @ Some((mut b @ ref mut c, ref d @ ref e)) => {} @@ -392,7 +392,7 @@ error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:71:30 | LL | match Some([U, U]) { - | ------------ move occurs because value has type `std::option::Option<[main::U; 2]>`, which does not implement the `Copy` trait + | ------------ move occurs because value has type `Option<[U; 2]>`, which does not implement the `Copy` trait LL | mut a @ Some([ref b, ref mut c]) => {} | ---------------------^^^^^^^^^-- | | | @@ -403,7 +403,7 @@ error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:77:18 | LL | match Some(u()) { - | --------- move occurs because value has type `std::option::Option<main::U>`, which does not implement the `Copy` trait + | --------- move occurs because value has type `Option<U>`, which does not implement the `Copy` trait LL | a @ Some(ref b) => {} | ---------^^^^^- | | | @@ -419,7 +419,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait help: borrow this field in the pattern to avoid moving the value | LL | a @ Some((ref mut b @ ref mut c, d @ ref e)) => {} @@ -429,7 +429,7 @@ error[E0382]: use of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:83:38 | LL | match Some((u(), u())) { - | ---------------- move occurs because value has type `std::option::Option<(main::U, main::U)>`, which does not implement the `Copy` trait + | ---------------- move occurs because value has type `Option<(U, U)>`, which does not implement the `Copy` trait LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | -----------------------------^^^^^^^^^-- | | | @@ -445,7 +445,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait help: borrow this field in the pattern to avoid moving the value | LL | a @ Some((mut b @ ref mut c, ref d @ ref e)) => {} @@ -455,7 +455,7 @@ error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:93:30 | LL | match Some([u(), u()]) { - | ---------------- move occurs because value has type `std::option::Option<[main::U; 2]>`, which does not implement the `Copy` trait + | ---------------- move occurs because value has type `Option<[U; 2]>`, which does not implement the `Copy` trait LL | mut a @ Some([ref b, ref mut c]) => {} | ---------------------^^^^^^^^^-- | | | @@ -470,7 +470,7 @@ LL | fn f1(a @ ref b: U) {} | | | | | value borrowed here after move | value moved here - | move occurs because value has type `main::U`, which does not implement the `Copy` trait + | move occurs because value has type `U`, which does not implement the `Copy` trait error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:18:24 @@ -481,7 +481,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait error[E0382]: use of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:18:31 @@ -491,7 +491,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} | | | | | value used here after move | value moved here - | move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait + | move occurs because value has type `(U, U)`, which does not implement the `Copy` trait error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:18:39 @@ -502,7 +502,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} | | value borrowed here after move | value moved here | - = note: move occurs because value has type `main::U`, which does not implement the `Copy` trait + = note: move occurs because value has type `U`, which does not implement the `Copy` trait error[E0382]: borrow of moved value --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:25:27 @@ -512,7 +512,7 @@ LL | fn f3(a @ [ref mut b, ref c]: [U; 2]) {} | | | | | value borrowed here after move | value moved here - | move occurs because value has type `[main::U; 2]`, which does not implement the `Copy` trait + | move occurs because value has type `[U; 2]`, which does not implement the `Copy` trait error: aborting due to 48 previous errors diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr index b161054414a..695da9639af 100644 --- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr +++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr @@ -374,7 +374,7 @@ error[E0507]: cannot move out of `b` in pattern guard --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:66 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {} - | ^ move occurs because `b` has type `&mut main::U`, which does not implement the `Copy` trait + | ^ move occurs because `b` has type `&mut U`, which does not implement the `Copy` trait | = note: variables bound in patterns cannot be moved from until after the end of the pattern guard @@ -382,7 +382,7 @@ error[E0507]: cannot move out of `b` in pattern guard --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:66 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {} - | ^ move occurs because `b` has type `&mut main::U`, which does not implement the `Copy` trait + | ^ move occurs because `b` has type `&mut U`, which does not implement the `Copy` trait | = note: variables bound in patterns cannot be moved from until after the end of the pattern guard @@ -390,7 +390,7 @@ error[E0507]: cannot move out of `a` in pattern guard --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:66 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {} - | ^ move occurs because `a` has type `&mut std::result::Result<main::U, main::U>`, which does not implement the `Copy` trait + | ^ move occurs because `a` has type `&mut std::result::Result<U, U>`, which does not implement the `Copy` trait | = note: variables bound in patterns cannot be moved from until after the end of the pattern guard @@ -398,7 +398,7 @@ error[E0507]: cannot move out of `a` in pattern guard --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:66 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {} - | ^ move occurs because `a` has type `&mut std::result::Result<main::U, main::U>`, which does not implement the `Copy` trait + | ^ move occurs because `a` has type `&mut std::result::Result<U, U>`, which does not implement the `Copy` trait | = note: variables bound in patterns cannot be moved from until after the end of the pattern guard diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr index ae7c8f38e1e..1cd3e267b99 100644 --- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr +++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr @@ -96,7 +96,7 @@ LL | let a @ (ref mut b, ref mut c) = (U, U); | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `(main::U, main::U)` which does not implement the `Copy` trait + | move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-ref-mut-twice.rs:70:9 @@ -108,7 +108,7 @@ LL | let a @ (b, [c, d]) = &mut val; // Same as ^-- | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `&mut (main::U, [main::U; 2])` which does not implement the `Copy` trait + | move occurs because `a` has type `&mut (U, [U; 2])` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-ref-mut-twice.rs:74:9 @@ -118,7 +118,7 @@ LL | let a @ &mut ref mut b = &mut U; | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `&mut main::U` which does not implement the `Copy` trait + | move occurs because `a` has type `&mut U` which does not implement the `Copy` trait error: borrow of moved value --> $DIR/borrowck-pat-ref-mut-twice.rs:77:9 @@ -129,7 +129,7 @@ LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U); | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `&mut (main::U, main::U)` which does not implement the `Copy` trait + | move occurs because `a` has type `&mut (U, U)` which does not implement the `Copy` trait error: cannot borrow value as mutable more than once at a time --> $DIR/borrowck-pat-ref-mut-twice.rs:82:9 @@ -286,7 +286,7 @@ error[E0382]: borrow of moved value --> $DIR/borrowck-pat-ref-mut-twice.rs:66:25 | LL | let a @ (ref mut b, ref mut c) = (U, U); - | ----------------^^^^^^^^^- ------ move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait + | ----------------^^^^^^^^^- ------ move occurs because value has type `(U, U)`, which does not implement the `Copy` trait | | | | | value borrowed here after move | value moved here @@ -295,7 +295,7 @@ error[E0382]: borrow of moved value --> $DIR/borrowck-pat-ref-mut-twice.rs:70:21 | LL | let a @ (b, [c, d]) = &mut val; // Same as ^-- - | ------------^-- -------- move occurs because value has type `&mut (main::U, [main::U; 2])`, which does not implement the `Copy` trait + | ------------^-- -------- move occurs because value has type `&mut (U, [U; 2])`, which does not implement the `Copy` trait | | | | | value borrowed here after move | value moved here @@ -304,7 +304,7 @@ error[E0382]: borrow of moved value --> $DIR/borrowck-pat-ref-mut-twice.rs:74:18 | LL | let a @ &mut ref mut b = &mut U; - | ---------^^^^^^^^^ ------ move occurs because value has type `&mut main::U`, which does not implement the `Copy` trait + | ---------^^^^^^^^^ ------ move occurs because value has type `&mut U`, which does not implement the `Copy` trait | | | | | value borrowed here after move | value moved here @@ -313,7 +313,7 @@ error[E0382]: borrow of moved value --> $DIR/borrowck-pat-ref-mut-twice.rs:77:30 | LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U); - | ---------------------^^^^^^^^^- ----------- move occurs because value has type `&mut (main::U, main::U)`, which does not implement the `Copy` trait + | ---------------------^^^^^^^^^- ----------- move occurs because value has type `&mut (U, U)`, which does not implement the `Copy` trait | | | | | value borrowed here after move | value moved here diff --git a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr index 141d667c746..a63a5a1e6c7 100644 --- a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr +++ b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr @@ -33,7 +33,7 @@ LL | Ok(ref a @ b) | Err(b @ ref a) => { | | | | | value borrowed here after move | value moved into `b` here - | move occurs because `b` has type `main::NotCopy` which does not implement the `Copy` trait + | move occurs because `b` has type `NotCopy` which does not implement the `Copy` trait error: cannot move out of value because it is borrowed --> $DIR/default-binding-modes-both-sides-independent.rs:44:9 diff --git a/src/test/ui/pattern/move-ref-patterns/feature-gate-move_ref_pattern.stderr b/src/test/ui/pattern/move-ref-patterns/feature-gate-move_ref_pattern.stderr index eb5391a95de..5335569a972 100644 --- a/src/test/ui/pattern/move-ref-patterns/feature-gate-move_ref_pattern.stderr +++ b/src/test/ui/pattern/move-ref-patterns/feature-gate-move_ref_pattern.stderr @@ -49,7 +49,7 @@ LL | let (a, mut b) = &tup; | ----- ^^^^ | | | data moved here - | move occurs because `b` has type `main::X`, which does not implement the `Copy` trait + | move occurs because `b` has type `X`, which does not implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/feature-gate-move_ref_pattern.rs:20:22 @@ -58,7 +58,7 @@ LL | let (mut a, b) = &mut tup; | ----- ^^^^^^^^ | | | data moved here - | move occurs because `a` has type `main::X`, which does not implement the `Copy` trait + | move occurs because `a` has type `X`, which does not implement the `Copy` trait error: aborting due to 6 previous errors diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr index 9159e3e2213..9ad84879595 100644 --- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr +++ b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr @@ -2,7 +2,7 @@ error[E0382]: borrow of moved value: `tup0` --> $DIR/move-ref-patterns-closure-captures-inside.rs:33:10 | LL | let mut tup0 = (S, S); - | -------- move occurs because `tup0` has type `(main::S, main::S)`, which does not implement the `Copy` trait + | -------- move occurs because `tup0` has type `(S, S)`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -17,7 +17,7 @@ error[E0382]: borrow of moved value: `tup1` --> $DIR/move-ref-patterns-closure-captures-inside.rs:34:10 | LL | let mut tup1 = (S, S, S); - | -------- move occurs because `tup1` has type `(main::S, main::S, main::S)`, which does not implement the `Copy` trait + | -------- move occurs because `tup1` has type `(S, S, S)`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -32,7 +32,7 @@ error[E0382]: borrow of moved value: `tup2` --> $DIR/move-ref-patterns-closure-captures-inside.rs:35:10 | LL | let tup2 = (S, S); - | ---- move occurs because `tup2` has type `(main::S, main::S)`, which does not implement the `Copy` trait + | ---- move occurs because `tup2` has type `(S, S)`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -47,7 +47,7 @@ error[E0382]: borrow of moved value: `tup3` --> $DIR/move-ref-patterns-closure-captures-inside.rs:36:10 | LL | let tup3 = (S, S, S); - | ---- move occurs because `tup3` has type `(main::S, main::S, main::S)`, which does not implement the `Copy` trait + | ---- move occurs because `tup3` has type `(S, S, S)`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -62,7 +62,7 @@ error[E0382]: borrow of moved value: `tup4` --> $DIR/move-ref-patterns-closure-captures-inside.rs:41:10 | LL | let tup4 = (S, S); - | ---- move occurs because `tup4` has type `(main::S, main::S)`, which does not implement the `Copy` trait + | ---- move occurs because `tup4` has type `(S, S)`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -77,7 +77,7 @@ error[E0382]: borrow of moved value: `arr0` --> $DIR/move-ref-patterns-closure-captures-inside.rs:43:10 | LL | let mut arr0 = [S, S, S]; - | -------- move occurs because `arr0` has type `[main::S; 3]`, which does not implement the `Copy` trait + | -------- move occurs because `arr0` has type `[S; 3]`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -92,7 +92,7 @@ error[E0382]: borrow of moved value: `arr1` --> $DIR/move-ref-patterns-closure-captures-inside.rs:44:36 | LL | let mut arr1 = [S, S, S, S, S]; - | -------- move occurs because `arr1` has type `[main::S; 5]`, which does not implement the `Copy` trait + | -------- move occurs because `arr1` has type `[S; 5]`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -107,7 +107,7 @@ error[E0382]: borrow of moved value: `arr2` --> $DIR/move-ref-patterns-closure-captures-inside.rs:45:10 | LL | let arr2 = [S, S, S]; - | ---- move occurs because `arr2` has type `[main::S; 3]`, which does not implement the `Copy` trait + | ---- move occurs because `arr2` has type `[S; 3]`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -122,7 +122,7 @@ error[E0382]: borrow of moved value: `arr3` --> $DIR/move-ref-patterns-closure-captures-inside.rs:46:36 | LL | let arr3 = [S, S, S, S, S]; - | ---- move occurs because `arr3` has type `[main::S; 5]`, which does not implement the `Copy` trait + | ---- move occurs because `arr3` has type `[S; 5]`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -137,7 +137,7 @@ error[E0382]: borrow of moved value: `tup0` --> $DIR/move-ref-patterns-closure-captures-inside.rs:77:10 | LL | let mut tup0: Option<(S, S)> = None; - | -------- move occurs because `tup0` has type `std::option::Option<(main::S, main::S)>`, which does not implement the `Copy` trait + | -------- move occurs because `tup0` has type `Option<(S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -151,7 +151,7 @@ error[E0382]: borrow of moved value: `tup1` --> $DIR/move-ref-patterns-closure-captures-inside.rs:78:10 | LL | let mut tup1: Option<(S, S, S)> = None; - | -------- move occurs because `tup1` has type `std::option::Option<(main::S, main::S, main::S)>`, which does not implement the `Copy` trait + | -------- move occurs because `tup1` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -166,7 +166,7 @@ error[E0382]: borrow of moved value: `tup2` --> $DIR/move-ref-patterns-closure-captures-inside.rs:79:10 | LL | let tup2: Option<(S, S)> = None; - | ---- move occurs because `tup2` has type `std::option::Option<(main::S, main::S)>`, which does not implement the `Copy` trait + | ---- move occurs because `tup2` has type `Option<(S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -181,7 +181,7 @@ error[E0382]: borrow of moved value: `tup3` --> $DIR/move-ref-patterns-closure-captures-inside.rs:80:10 | LL | let tup3: Option<(S, S, S)> = None; - | ---- move occurs because `tup3` has type `std::option::Option<(main::S, main::S, main::S)>`, which does not implement the `Copy` trait + | ---- move occurs because `tup3` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -196,7 +196,7 @@ error[E0382]: borrow of moved value: `tup4` --> $DIR/move-ref-patterns-closure-captures-inside.rs:81:21 | LL | let tup4: Option<(S, S)> = None; - | ---- move occurs because `tup4` has type `std::option::Option<(main::S, main::S)>`, which does not implement the `Copy` trait + | ---- move occurs because `tup4` has type `Option<(S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -211,7 +211,7 @@ error[E0382]: borrow of moved value: `arr0` --> $DIR/move-ref-patterns-closure-captures-inside.rs:82:10 | LL | let mut arr0: Option<[S; 3]> = None; - | -------- move occurs because `arr0` has type `std::option::Option<[main::S; 3]>`, which does not implement the `Copy` trait + | -------- move occurs because `arr0` has type `Option<[S; 3]>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -226,7 +226,7 @@ error[E0382]: borrow of moved value: `arr1` --> $DIR/move-ref-patterns-closure-captures-inside.rs:83:35 | LL | let mut arr1: Option<[S; 5]> = None; - | -------- move occurs because `arr1` has type `std::option::Option<[main::S; 5]>`, which does not implement the `Copy` trait + | -------- move occurs because `arr1` has type `Option<[S; 5]>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -241,7 +241,7 @@ error[E0382]: borrow of moved value: `arr2` --> $DIR/move-ref-patterns-closure-captures-inside.rs:84:10 | LL | let arr2: Option<[S; 3]> = None; - | ---- move occurs because `arr2` has type `std::option::Option<[main::S; 3]>`, which does not implement the `Copy` trait + | ---- move occurs because `arr2` has type `Option<[S; 3]>`, which does not implement the `Copy` trait LL | let arr3: Option<[S; 5]> = None; LL | let mut closure = || { | -- value moved into closure here @@ -256,7 +256,7 @@ error[E0382]: borrow of moved value: `arr3` --> $DIR/move-ref-patterns-closure-captures-inside.rs:85:35 | LL | let arr3: Option<[S; 5]> = None; - | ---- move occurs because `arr3` has type `std::option::Option<[main::S; 5]>`, which does not implement the `Copy` trait + | ---- move occurs because `arr3` has type `Option<[S; 5]>`, which does not implement the `Copy` trait LL | let mut closure = || { | -- value moved into closure here ... @@ -270,7 +270,7 @@ error[E0382]: borrow of moved value: `tup0` --> $DIR/move-ref-patterns-closure-captures-inside.rs:113:10 | LL | let mut tup0: Option<(S, S)> = None; - | -------- move occurs because `tup0` has type `std::option::Option<(main::S, main::S)>`, which does not implement the `Copy` trait + | -------- move occurs because `tup0` has type `Option<(S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -284,7 +284,7 @@ error[E0382]: borrow of moved value: `tup1` --> $DIR/move-ref-patterns-closure-captures-inside.rs:114:10 | LL | let mut tup1: Option<(S, S, S)> = None; - | -------- move occurs because `tup1` has type `std::option::Option<(main::S, main::S, main::S)>`, which does not implement the `Copy` trait + | -------- move occurs because `tup1` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -299,7 +299,7 @@ error[E0382]: borrow of moved value: `tup2` --> $DIR/move-ref-patterns-closure-captures-inside.rs:115:10 | LL | let tup2: Option<(S, S)> = None; - | ---- move occurs because `tup2` has type `std::option::Option<(main::S, main::S)>`, which does not implement the `Copy` trait + | ---- move occurs because `tup2` has type `Option<(S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -314,7 +314,7 @@ error[E0382]: borrow of moved value: `tup3` --> $DIR/move-ref-patterns-closure-captures-inside.rs:116:10 | LL | let tup3: Option<(S, S, S)> = None; - | ---- move occurs because `tup3` has type `std::option::Option<(main::S, main::S, main::S)>`, which does not implement the `Copy` trait + | ---- move occurs because `tup3` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -329,7 +329,7 @@ error[E0382]: borrow of moved value: `tup4` --> $DIR/move-ref-patterns-closure-captures-inside.rs:117:21 | LL | let tup4: Option<(S, S)> = None; - | ---- move occurs because `tup4` has type `std::option::Option<(main::S, main::S)>`, which does not implement the `Copy` trait + | ---- move occurs because `tup4` has type `Option<(S, S)>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -344,7 +344,7 @@ error[E0382]: borrow of moved value: `arr0` --> $DIR/move-ref-patterns-closure-captures-inside.rs:118:10 | LL | let mut arr0: Option<[S; 3]> = None; - | -------- move occurs because `arr0` has type `std::option::Option<[main::S; 3]>`, which does not implement the `Copy` trait + | -------- move occurs because `arr0` has type `Option<[S; 3]>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -359,7 +359,7 @@ error[E0382]: borrow of moved value: `arr1` --> $DIR/move-ref-patterns-closure-captures-inside.rs:119:35 | LL | let mut arr1: Option<[S; 5]> = None; - | -------- move occurs because `arr1` has type `std::option::Option<[main::S; 5]>`, which does not implement the `Copy` trait + | -------- move occurs because `arr1` has type `Option<[S; 5]>`, which does not implement the `Copy` trait ... LL | let mut closure = || { | -- value moved into closure here @@ -374,7 +374,7 @@ error[E0382]: borrow of moved value: `arr2` --> $DIR/move-ref-patterns-closure-captures-inside.rs:120:10 | LL | let arr2: Option<[S; 3]> = None; - | ---- move occurs because `arr2` has type `std::option::Option<[main::S; 3]>`, which does not implement the `Copy` trait + | ---- move occurs because `arr2` has type `Option<[S; 3]>`, which does not implement the `Copy` trait LL | let arr3: Option<[S; 5]> = None; LL | let mut closure = || { | -- value moved into closure here @@ -389,7 +389,7 @@ error[E0382]: borrow of moved value: `arr3` --> $DIR/move-ref-patterns-closure-captures-inside.rs:121:35 | LL | let arr3: Option<[S; 5]> = None; - | ---- move occurs because `arr3` has type `std::option::Option<[main::S; 5]>`, which does not implement the `Copy` trait + | ---- move occurs because `arr3` has type `Option<[S; 5]>`, which does not implement the `Copy` trait LL | let mut closure = || { | -- value moved into closure here ... diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.stderr b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.stderr index fe7f71e6c46..f92699f5c3c 100644 --- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.stderr +++ b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.stderr @@ -5,7 +5,7 @@ LL | let (a, mut b) = &p; | ----- ^^ | | | data moved here - | move occurs because `b` has type `main::U`, which does not implement the `Copy` trait + | move occurs because `b` has type `U`, which does not implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/move-ref-patterns-default-binding-modes.rs:14:22 @@ -14,7 +14,7 @@ LL | let (a, mut b) = &mut p; | ----- ^^^^^^ | | | data moved here - | move occurs because `b` has type `main::U`, which does not implement the `Copy` trait + | move occurs because `b` has type `U`, which does not implement the `Copy` trait error: aborting due to 2 previous errors diff --git a/src/test/ui/pattern/pat-type-err-formal-param.stderr b/src/test/ui/pattern/pat-type-err-formal-param.stderr index 2d7eb62faef..206713a4bfc 100644 --- a/src/test/ui/pattern/pat-type-err-formal-param.stderr +++ b/src/test/ui/pattern/pat-type-err-formal-param.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn foo(Tuple(_): String) {} | ^^^^^^^^ ------ expected due to this | | - | expected struct `std::string::String`, found struct `Tuple` + | expected struct `String`, found struct `Tuple` error: aborting due to previous error diff --git a/src/test/ui/pattern/pat-type-err-let-stmt.stderr b/src/test/ui/pattern/pat-type-err-let-stmt.stderr index d75fa3f247c..42258cfc1ae 100644 --- a/src/test/ui/pattern/pat-type-err-let-stmt.stderr +++ b/src/test/ui/pattern/pat-type-err-let-stmt.stderr @@ -4,11 +4,11 @@ error[E0308]: mismatched types LL | let Ok(0): Option<u8> = 42u8; | ---------- ^^^^ | | | - | | expected enum `std::option::Option`, found `u8` + | | expected enum `Option`, found `u8` | | help: try using a variant of the expected enum: `Some(42u8)` | expected due to this | - = note: expected enum `std::option::Option<u8>` + = note: expected enum `Option<u8>` found type `u8` error[E0308]: mismatched types @@ -17,9 +17,9 @@ error[E0308]: mismatched types LL | let Ok(0): Option<u8> = 42u8; | ^^^^^ ---------- expected due to this | | - | expected enum `std::option::Option`, found enum `std::result::Result` + | expected enum `Option`, found enum `std::result::Result` | - = note: expected enum `std::option::Option<u8>` + = note: expected enum `Option<u8>` found enum `std::result::Result<_, _>` error[E0308]: mismatched types @@ -28,9 +28,9 @@ error[E0308]: mismatched types LL | let Ok(0): Option<u8>; | ^^^^^ ---------- expected due to this | | - | expected enum `std::option::Option`, found enum `std::result::Result` + | expected enum `Option`, found enum `std::result::Result` | - = note: expected enum `std::option::Option<u8>` + = note: expected enum `Option<u8>` found enum `std::result::Result<_, _>` error[E0308]: mismatched types diff --git a/src/test/ui/pattern/pattern-ident-path-generics.stderr b/src/test/ui/pattern/pattern-ident-path-generics.stderr index 24b5cdf98d5..01b082bd35b 100644 --- a/src/test/ui/pattern/pattern-ident-path-generics.stderr +++ b/src/test/ui/pattern/pattern-ident-path-generics.stderr @@ -2,12 +2,12 @@ error[E0308]: mismatched types --> $DIR/pattern-ident-path-generics.rs:3:9 | LL | match Some("foo") { - | ----------- this expression has type `std::option::Option<&str>` + | ----------- this expression has type `Option<&str>` LL | None::<isize> => {} | ^^^^^^^^^^^^^ expected `&str`, found `isize` | - = note: expected enum `std::option::Option<&str>` - found enum `std::option::Option<isize>` + = note: expected enum `Option<&str>` + found enum `Option<isize>` error: aborting due to previous error diff --git a/src/test/ui/pattern/pattern-tyvar-2.rs b/src/test/ui/pattern/pattern-tyvar-2.rs index 4c6d515b86a..532df4fa0cb 100644 --- a/src/test/ui/pattern/pattern-tyvar-2.rs +++ b/src/test/ui/pattern/pattern-tyvar-2.rs @@ -1,6 +1,6 @@ enum Bar { T1((), Option<Vec<isize>>), T2, } fn foo(t: Bar) -> isize { match t { Bar::T1(_, Some(x)) => { return x * 3; } _ => { panic!(); } } } -//~^ ERROR cannot multiply `{integer}` to `std::vec::Vec<isize>` +//~^ ERROR cannot multiply `{integer}` to `Vec<isize>` fn main() { } diff --git a/src/test/ui/pattern/pattern-tyvar-2.stderr b/src/test/ui/pattern/pattern-tyvar-2.stderr index 95662444640..e205cd9015e 100644 --- a/src/test/ui/pattern/pattern-tyvar-2.stderr +++ b/src/test/ui/pattern/pattern-tyvar-2.stderr @@ -1,10 +1,10 @@ -error[E0369]: cannot multiply `{integer}` to `std::vec::Vec<isize>` +error[E0369]: cannot multiply `{integer}` to `Vec<isize>` --> $DIR/pattern-tyvar-2.rs:3:71 | LL | fn foo(t: Bar) -> isize { match t { Bar::T1(_, Some(x)) => { return x * 3; } _ => { panic!(); } } } | - ^ - {integer} | | - | std::vec::Vec<isize> + | Vec<isize> error: aborting due to previous error diff --git a/src/test/ui/pattern/pattern-tyvar.stderr b/src/test/ui/pattern/pattern-tyvar.stderr index 15425da69bc..f1e2a9d72ce 100644 --- a/src/test/ui/pattern/pattern-tyvar.stderr +++ b/src/test/ui/pattern/pattern-tyvar.stderr @@ -4,10 +4,10 @@ error[E0308]: mismatched types LL | match t { | - this expression has type `Bar` LL | Bar::T1(_, Some::<isize>(x)) => { - | ^^^^^^^^^^^^^^^^ expected struct `std::vec::Vec`, found `isize` + | ^^^^^^^^^^^^^^^^ expected struct `Vec`, found `isize` | - = note: expected enum `std::option::Option<std::vec::Vec<isize>>` - found enum `std::option::Option<isize>` + = note: expected enum `Option<Vec<isize>>` + found enum `Option<isize>` error: aborting due to previous error diff --git a/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr b/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr index 161ac477183..de831520598 100644 --- a/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr +++ b/src/test/ui/pattern/usefulness/exhaustive_integer_patterns.stderr @@ -77,7 +77,7 @@ LL | match (0u8, Some(())) { | ^^^^^^^^^^^^^^^ patterns `(0_u8, Some(_))` and `(2_u8..=u8::MAX, Some(_))` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - = note: the matched value is of type `(u8, std::option::Option<()>)` + = note: the matched value is of type `(u8, Option<()>)` error[E0004]: non-exhaustive patterns: `(126_u8..=127_u8, false)` not covered --> $DIR/exhaustive_integer_patterns.rs:126:11 diff --git a/src/test/ui/pattern/usefulness/issue-35609.stderr b/src/test/ui/pattern/usefulness/issue-35609.stderr index 66f904aced1..0598c8d6f38 100644 --- a/src/test/ui/pattern/usefulness/issue-35609.stderr +++ b/src/test/ui/pattern/usefulness/issue-35609.stderr @@ -74,7 +74,7 @@ LL | match Some(A) { | ^^^^^^^ patterns `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - = note: the matched value is of type `std::option::Option<Enum>` + = note: the matched value is of type `Option<Enum>` error: aborting due to 8 previous errors diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr index d541597508d..f515525123e 100644 --- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr +++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr @@ -22,7 +22,7 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), | not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - = note: the matched value is of type `std::option::Option<std::option::Option<Direction>>` + = note: the matched value is of type `Option<Option<Direction>>` error[E0004]: non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }` not covered --> $DIR/match-arm-statics-2.rs:48:11 diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr index ca9006469e2..cd157debcd4 100644 --- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr +++ b/src/test/ui/pattern/usefulness/match-privately-empty.stderr @@ -10,7 +10,7 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), | ---- not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - = note: the matched value is of type `std::option::Option<private::Private>` + = note: the matched value is of type `Option<Private>` error: aborting due to previous error diff --git a/src/test/ui/pattern/usefulness/match-slice-patterns.stderr b/src/test/ui/pattern/usefulness/match-slice-patterns.stderr index ba5312d2135..88f27be0412 100644 --- a/src/test/ui/pattern/usefulness/match-slice-patterns.stderr +++ b/src/test/ui/pattern/usefulness/match-slice-patterns.stderr @@ -5,7 +5,7 @@ LL | match list { | ^^^^ pattern `&[_, Some(_), .., None, _]` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - = note: the matched value is of type `&[std::option::Option<()>]` + = note: the matched value is of type `&[Option<()>]` error: aborting due to previous error diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr index c9f26db6f1f..d1cab752102 100644 --- a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr @@ -5,7 +5,7 @@ LL | match (l1, l2) { | ^^^^^^^^ pattern `(Some(&[]), Err(_))` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - = note: the matched value is of type `(std::option::Option<&[T]>, std::result::Result<&[T], ()>)` + = note: the matched value is of type `(Option<&[T]>, std::result::Result<&[T], ()>)` error[E0004]: non-exhaustive patterns: `A(C)` not covered --> $DIR/non-exhaustive-match-nested.rs:15:11 diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr index 5d29feb5626..12412743b83 100644 --- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr @@ -34,7 +34,7 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), | ---- not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - = note: the matched value is of type `std::option::Option<i32>` + = note: the matched value is of type `Option<i32>` error[E0004]: non-exhaustive patterns: `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_i32..=i32::MAX)` not covered --> $DIR/non-exhaustive-match.rs:14:11 @@ -76,7 +76,7 @@ LL | match *vec { | ^^^^ pattern `[]` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - = note: the matched value is of type `[std::option::Option<isize>]` + = note: the matched value is of type `[Option<isize>]` error[E0004]: non-exhaustive patterns: `[_, _, _, _, ..]` not covered --> $DIR/non-exhaustive-match.rs:46:11 diff --git a/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr b/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr index 8d0409a6af9..99af71cadfc 100644 --- a/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr +++ b/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr @@ -4,7 +4,7 @@ error[E0005]: refutable pattern in function argument: `(_, _)` not covered LL | fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) { } | ^^^^^^^^^^^^^^^^^^^^^ pattern `(_, _)` not covered | - = note: the matched value is of type `(isize, (std::option::Option<isize>, isize))` + = note: the matched value is of type `(isize, (Option<isize>, isize))` error[E0005]: refutable pattern in local binding: `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered --> $DIR/refutable-pattern-errors.rs:7:9 @@ -14,7 +14,7 @@ LL | let (1, (Some(1), 2..=3)) = (1, (None, 2)); | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html - = note: the matched value is of type `(i32, (std::option::Option<i32>, i32))` + = note: the matched value is of type `(i32, (Option<i32>, i32))` help: you might want to use `if let` to ignore the variant that isn't matched | LL | if let (1, (Some(1), 2..=3)) = (1, (None, 2)) { /* */ } |
