sym::or_patterns,
sym::let_chains,
sym::raw_dylib,
- sym::bindings_after_at,
];
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
fn main() {
let x = Some("s".to_string());
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/E0007.rs:1:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/E0007.rs:7:9
+ --> $DIR/E0007.rs:6:9
|
LL | op_string @ Some(s) => {},
| ^^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0382]: use of moved value
- --> $DIR/E0007.rs:7:26
+ --> $DIR/E0007.rs:6:26
|
LL | let x = Some("s".to_string());
| - move occurs because `x` has type `std::option::Option<std::string::String>`, which does not implement the `Copy` trait
// where one side is by-ref and the other is by-move.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
struct X { x: () }
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:5:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:13:23
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:12:23
|
LL | Some(ref _y @ _z) => { },
| ---------^^
| by-ref pattern here
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:19:14
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:18:14
|
LL | Some(_z @ ref _y) => { },
| ^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:26:27
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:25:27
|
LL | Some(ref mut _y @ _z) => { },
| -------------^^
| by-ref pattern here
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:32:14
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:31:14
|
LL | Some(_z @ ref mut _y) => { },
| ^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0382]: borrow of moved value
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:19:19
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:18:19
|
LL | Some(_z @ ref _y) => { },
| -----^^^^^^
= note: move occurs because value has type `X`, which does not implement the `Copy` trait
error[E0382]: borrow of moved value
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:32:19
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:31:19
|
LL | Some(_z @ ref mut _y) => { },
| -----^^^^^^^^^^
// See issue #12534.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
fn main() {}
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/bind-by-move-no-subbindings-fun-param.rs:3:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/bind-by-move-no-subbindings-fun-param.rs:10:6
+ --> $DIR/bind-by-move-no-subbindings-fun-param.rs:9:6
|
LL | fn f(a @ A(u): A) -> Box<u8> {
| ^^^^^^^^ binds an already bound by-move value by moving it
error[E0382]: use of moved value
- --> $DIR/bind-by-move-no-subbindings-fun-param.rs:10:12
+ --> $DIR/bind-by-move-no-subbindings-fun-param.rs:9:12
|
LL | fn f(a @ A(u): A) -> Box<u8> {
| ------^-
// Test that moving on both sides of an `@` pattern is not allowed.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
#![feature(slice_patterns)]
fn main() {
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/borrowck-move-and-move.rs:3:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-move-and-move.rs:13:9
+ --> $DIR/borrowck-move-and-move.rs:12:9
|
LL | let a @ b = U;
| ^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-move-and-move.rs:17:9
+ --> $DIR/borrowck-move-and-move.rs:16:9
|
LL | let a @ (b, c) = (U, U);
| ^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-move-and-move.rs:21:9
+ --> $DIR/borrowck-move-and-move.rs:20:9
|
LL | let a @ (b, c) = (u(), u());
| ^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-move-and-move.rs:26:9
+ --> $DIR/borrowck-move-and-move.rs:25:9
|
LL | a @ Ok(b) | a @ Err(b) => {}
| ^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-move-and-move.rs:26:21
+ --> $DIR/borrowck-move-and-move.rs:25:21
|
LL | a @ Ok(b) | a @ Err(b) => {}
| ^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-move-and-move.rs:38:9
+ --> $DIR/borrowck-move-and-move.rs:37:9
|
LL | xs @ [a, .., b] => {}
| ^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-move-and-move.rs:44:9
+ --> $DIR/borrowck-move-and-move.rs:43:9
|
LL | xs @ [_, ys @ .., _] => {}
| ^^^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-move-and-move.rs:33:12
+ --> $DIR/borrowck-move-and-move.rs:32:12
|
LL | fn fun(a @ b: U) {}
| ^^^^^ binds an already bound by-move value by moving it
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:13:13
+ --> $DIR/borrowck-move-and-move.rs:12:13
|
LL | let a @ b = U;
| ----^ - move occurs because value has type `main::U`, which does not implement the `Copy` trait
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:17:17
+ --> $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
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:21:17
+ --> $DIR/borrowck-move-and-move.rs:20: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
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:26:16
+ --> $DIR/borrowck-move-and-move.rs:25: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
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:26:29
+ --> $DIR/borrowck-move-and-move.rs:25: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
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:38:22
+ --> $DIR/borrowck-move-and-move.rs:37:22
|
LL | match [u(), u(), u(), u()] {
| -------------------- move occurs because value has type `[main::U; 4]`, which does not implement the `Copy` trait
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:44:18
+ --> $DIR/borrowck-move-and-move.rs:43:18
|
LL | match [u(), u(), u(), u()] {
| -------------------- move occurs because value has type `[main::U; 4]`, which does not implement the `Copy` trait
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:33:16
+ --> $DIR/borrowck-move-and-move.rs:32:16
|
LL | fn fun(a @ b: U) {}
| ----^
// Test `@` patterns combined with `box` patterns.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
#![feature(box_patterns)]
#![feature(slice_patterns)]
+++ /dev/null
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/borrowck-pat-at-and-box-pass.rs:5:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
// Test `@` patterns combined with `box` patterns.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
#![feature(box_patterns)]
#![feature(slice_patterns)]
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/borrowck-pat-at-and-box.rs:3:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-pat-at-and-box.rs:18:9
+ --> $DIR/borrowck-pat-at-and-box.rs:17:9
|
LL | let a @ box &b = Box::new(&C);
| ^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-pat-at-and-box.rs:22:9
+ --> $DIR/borrowck-pat-at-and-box.rs:21:9
|
LL | let a @ box b = Box::new(C);
| ^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-pat-at-and-box.rs:34:25
+ --> $DIR/borrowck-pat-at-and-box.rs:33:25
|
LL | match Box::new(C) { a @ box b => {} }
| ^^^^^^^^^ binds an already bound by-move value by moving it
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/borrowck-pat-at-and-box.rs:38:21
+ --> $DIR/borrowck-pat-at-and-box.rs:37:21
|
LL | let ref a @ box b = Box::new(NC);
| ------------^
| by-ref pattern here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:40:9
+ --> $DIR/borrowck-pat-at-and-box.rs:39:9
|
LL | let ref a @ box ref mut b = Box::new(nc());
| -----^^^^^^^---------
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:42:9
+ --> $DIR/borrowck-pat-at-and-box.rs:41:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
| -----^^^^^^^---------
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:44:9
+ --> $DIR/borrowck-pat-at-and-box.rs:43:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
| -----^^^^^^^---------
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:47:9
+ --> $DIR/borrowck-pat-at-and-box.rs:46:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
| -----^^^^^^^---------
| immutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:53:9
+ --> $DIR/borrowck-pat-at-and-box.rs:52:9
|
LL | let ref mut a @ box ref b = Box::new(NC);
| ---------^^^^^^^-----
| mutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:67:9
+ --> $DIR/borrowck-pat-at-and-box.rs:66:9
|
LL | ref mut a @ box ref b => {
| ---------^^^^^^^-----
| mutable borrow occurs here
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/borrowck-pat-at-and-box.rs:76:38
+ --> $DIR/borrowck-pat-at-and-box.rs:75:38
|
LL | box [Ok(a), ref xs @ .., Err(b)] => {}
| ----------- ^ by-move pattern here
| by-ref pattern here
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/borrowck-pat-at-and-box.rs:82:46
+ --> $DIR/borrowck-pat-at-and-box.rs:81:46
|
LL | [Ok(box ref a), ref xs @ .., Err(box b), Err(box ref mut c)] => {}
| ----- ----------- ^ --------- by-ref pattern here
| by-ref pattern here
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-pat-at-and-box.rs:26:11
+ --> $DIR/borrowck-pat-at-and-box.rs:25:11
|
LL | fn f1(a @ box &b: Box<&C>) {}
| ^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-pat-at-and-box.rs:30:11
+ --> $DIR/borrowck-pat-at-and-box.rs:29:11
|
LL | fn f2(a @ box b: Box<C>) {}
| ^^^^^^^^^ binds an already bound by-move value by moving it
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:59:11
+ --> $DIR/borrowck-pat-at-and-box.rs:58:11
|
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
| ---------^^^^^^^-----
| mutable borrow occurs here
error[E0382]: use of moved value
- --> $DIR/borrowck-pat-at-and-box.rs:18:18
+ --> $DIR/borrowck-pat-at-and-box.rs:17: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
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-pat-at-and-box.rs:22:17
+ --> $DIR/borrowck-pat-at-and-box.rs:21: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
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-pat-at-and-box.rs:34:33
+ --> $DIR/borrowck-pat-at-and-box.rs:33:33
|
LL | match Box::new(C) { a @ box b => {} }
| ----------- --------^
| move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:47:21
+ --> $DIR/borrowck-pat-at-and-box.rs:46:21
|
LL | let ref a @ box ref mut b = Box::new(NC);
| ------------^^^^^^^^^
| - immutable borrow later used here
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:53:25
+ --> $DIR/borrowck-pat-at-and-box.rs:52:25
|
LL | let ref mut a @ box ref b = Box::new(NC);
| ----------------^^^^^
| -- mutable borrow later used here
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:67:25
+ --> $DIR/borrowck-pat-at-and-box.rs:66:25
|
LL | ref mut a @ box ref b => {
| ----------------^^^^^
| -- mutable borrow later used here
error[E0382]: use of moved value
- --> $DIR/borrowck-pat-at-and-box.rs:26:20
+ --> $DIR/borrowck-pat-at-and-box.rs:25:20
|
LL | fn f1(a @ box &b: Box<&C>) {}
| ---------^
| move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
error[E0382]: use of moved value
- --> $DIR/borrowck-pat-at-and-box.rs:30:19
+ --> $DIR/borrowck-pat-at-and-box.rs:29:19
|
LL | fn f2(a @ box b: Box<C>) {}
| --------^
| move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:59:27
+ --> $DIR/borrowck-pat-at-and-box.rs:58:27
|
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
| ----------------^^^^^
#![feature(slice_patterns)]
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
#[derive(Copy, Clone)]
struct C;
+++ /dev/null
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/borrowck-pat-by-copy-bindings-in-at.rs:6:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
fn main() {
match Some("hi".to_string()) {
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/borrowck-pat-by-move-and-ref.rs:1:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/borrowck-pat-by-move-and-ref.rs:6:34
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:5:34
|
LL | ref op_string_ref @ Some(s) => {},
| -------------------------^-
// of an `@` pattern according to NLL borrowck.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
#![feature(slice_patterns)]
fn main() {
+++ /dev/null
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/borrowck-pat-ref-both-sides.rs:6:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
#![feature(slice_patterns)]
enum Option<T> {
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:1:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error: cannot borrow `z` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:12:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:11:9
|
LL | ref mut z @ &mut Some(ref a) => {
| ---------^^^^^^^^^^^^^-----^
| mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:33:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:32:9
|
LL | let ref mut a @ (ref b @ ref mut c) = u(); // sub-in-sub
| ---------^^^^-----------------^
| first mutable borrow occurs here
error: cannot borrow `b` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:33:22
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:32:22
|
LL | let ref mut a @ (ref b @ ref mut c) = u(); // sub-in-sub
| -----^^^---------
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:37:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:36:9
|
LL | let ref a @ ref mut b = U;
| -----^^^---------
| immutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:39:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:38:9
|
LL | let ref mut a @ ref b = U;
| ---------^^^-----
| mutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:41:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:40:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| -----^^^^---------^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:43:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:42:9
|
LL | let ref mut a @ (ref b, ref c) = (U, U);
| ---------^^^^-----^^-----^
| mutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:46:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:45:9
|
LL | let ref mut a @ ref b = u();
| ---------^^^-----
| mutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:51:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:50:9
|
LL | let ref a @ ref mut b = u();
| -----^^^---------
| immutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:57:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:56:9
|
LL | let ref mut a @ ref b = U;
| ---------^^^-----
| mutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:61:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:60:9
|
LL | let ref a @ ref mut b = U;
| -----^^^---------
| immutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:67:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:66:9
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) => {
| ---------^^^^^^-----^
| mutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:67:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:66:33
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) => {
| ---------^^^^^^^-----^
| mutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:75:9
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
| -----^^^^^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:75:33
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
| -----^^^^^^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:87:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:86:9
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {}
| -----^^^^^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:87:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:86:33
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {}
| -----^^^^^^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:94:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:93:9
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {}
| ---------^^^^^^-----^
| mutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:94:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:93:33
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {}
| ---------^^^^^^^-----^
| mutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:101:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:100:9
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
| -----^^^^^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:101:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:100:33
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
| -----^^^^^^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:108:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:107:9
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {}
| ---------^^^^^^-----^
| mutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:108:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:107:33
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {}
| ---------^^^^^^^-----^
| mutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:115:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:114:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| -----^^^^---------^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:120:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:119:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| -----^^^^---------^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:127:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:126:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| -----^^^^---------^^---------^
| immutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:132:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:131:9
|
LL | let ref mut a @ (ref b, ref c) = (U, U);
| ---------^^^^-----^^-----^
| mutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:26:11
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:25:11
|
LL | fn f1(ref a @ ref mut b: U) {}
| -----^^^---------
| immutable borrow occurs here
error: cannot borrow `a` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:28:11
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:27:11
|
LL | fn f2(ref mut a @ ref b: U) {}
| ---------^^^-----
| mutable borrow occurs here
error: cannot borrow `a` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:30:11
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:29:11
|
LL | fn f3(ref a @ [ref b, ref mut mid @ .., ref c]: [U; 4]) {}
| -----^^^^^^^^^^^----------------^^^^^^^^
| immutable borrow occurs here
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:12:31
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:11:31
|
LL | ref mut z @ &mut Some(ref a) => {
| ----------------------^^^^^-
| ---------- mutable borrow later used here
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:46:21
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:45:21
|
LL | let ref mut a @ ref b = u();
| ------------^^^^^
| -------- mutable borrow later used here
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:51:17
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:50:17
|
LL | let ref a @ ref mut b = u();
| --------^^^^^^^^^
| - immutable borrow later used here
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:20
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:75:20
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
| -----------^^^^^^^^^-
| - immutable borrow later used here
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:45
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:75:45
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
| ------------^^^^^^^^^-
| - immutable borrow later used here
error[E0594]: cannot assign to `*b`, as it is immutable for the pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:87:61
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:86:61
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {}
| ^^^^^^ cannot assign
= note: variables bound in patterns are immutable until the end of the pattern guard
error[E0594]: cannot assign to `*a`, as it is immutable for the pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:94:61
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:93:61
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {}
| ^^^^^^^^^^^ cannot assign
= note: variables bound in patterns are immutable until the end of the pattern guard
error[E0507]: cannot move out of `b` in pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:101:66
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:100: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
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
error[E0507]: cannot move out of `a` in pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:108:66
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:107: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
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:120:18
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:119:18
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| ---------^^^^^^^^^------------
| - immutable borrow later used here
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:120:29
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:119:29
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| --------------------^^^^^^^^^-
| - immutable borrow later used here
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:127:18
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:126:18
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| ---------^^^^^^^^^------------
| - immutable borrow later used here
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:127:29
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:126:29
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| --------------------^^^^^^^^^-
// Test that `ref mut x @ ref mut y` and varieties of that are not allowed.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
#![feature(slice_patterns)]
fn main() {
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/borrowck-pat-ref-mut-twice.rs:3:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:26:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:25:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:30:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:29:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:33:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:32:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:36:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:35:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:40:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:39:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:44:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:43:9
|
LL | let ref mut a @ (
| ^--------
| |_____^
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:54:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:53:9
|
LL | let ref mut a @ (
| ^--------
| |_________^
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-pat-ref-mut-twice.rs:64:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:63:9
|
LL | let a @ (ref mut b, ref mut c) = (U, U);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-pat-ref-mut-twice.rs:68:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:67:9
|
LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
| ^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-pat-ref-mut-twice.rs:72:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:71:9
|
LL | let a @ &mut ref mut b = &mut U;
| ^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/borrowck-pat-ref-mut-twice.rs:75:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:74:9
|
LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:80:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:79:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^---------^
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:80:37
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:79:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^^---------^
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:86:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:85:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^---------^
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:86:37
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:85:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^^---------^
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:93:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:92:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^---------^
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:93:37
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:92:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^^---------^
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:105:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:104:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^---------^
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:105:37
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:104:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^^---------^
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:12:11
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:11:11
|
LL | fn f1(ref mut a @ ref mut b: U) {}
| ---------^^^---------
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:14:11
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:13:11
|
LL | fn f2(ref mut a @ ref mut b: U) {}
| ---------^^^---------
| first mutable borrow occurs here
error: cannot borrow `a` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:17:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:16:9
|
LL | ref mut a @ [
| ^--------
| |_________^
error[E0499]: cannot borrow `_` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:26:21
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:25:21
|
LL | let ref mut a @ ref mut b = U;
| ------------^^^^^^^^^
| - first borrow later used here
error[E0499]: cannot borrow `_` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:36:21
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:35:21
|
LL | let ref mut a @ ref mut b = U;
| ------------^^^^^^^^^
| ------ first borrow later used here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-twice.rs:64:25
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:63: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
| value moved here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-twice.rs:68:21
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:67: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
| value moved here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-twice.rs:72:18
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:71: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
| value moved here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-twice.rs:75:30
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:74: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
| value moved here
error[E0499]: cannot borrow `_` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:93:24
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:92:24
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------------^^^^^^^^^-
| ----------- first borrow later used here
error[E0499]: cannot borrow `_` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:93:53
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:92:53
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ----------------^^^^^^^^^-
| ----------- first borrow later used here
error[E0499]: cannot borrow `_` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:105:24
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:104:24
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------------^^^^^^^^^-
| - first borrow later used here
error[E0499]: cannot borrow `_` as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:105:53
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:104:53
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ----------------^^^^^^^^^-
// Test that mixing `Copy` and non-`Copy` types in `@` patterns is forbidden.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
#[derive(Copy, Clone)]
struct C;
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/copy-and-move-mixed.rs:3:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/copy-and-move-mixed.rs:12:9
+ --> $DIR/copy-and-move-mixed.rs:11:9
|
LL | let a @ NC(b, c) = NC(C, C);
| ^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/copy-and-move-mixed.rs:16:9
+ --> $DIR/copy-and-move-mixed.rs:15:9
|
LL | let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
| ^^^^^^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0007]: cannot bind by-move with sub-bindings
- --> $DIR/copy-and-move-mixed.rs:16:19
+ --> $DIR/copy-and-move-mixed.rs:15:19
|
LL | let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
| ^^^^^^^^^^^^ binds an already bound by-move value by moving it
error[E0382]: use of moved value
- --> $DIR/copy-and-move-mixed.rs:12:19
+ --> $DIR/copy-and-move-mixed.rs:11:19
|
LL | let a @ NC(b, c) = NC(C, C);
| ----------^- -------- move occurs because value has type `NC<C, C>`, which does not implement the `Copy` trait
| value moved here
error[E0382]: use of moved value
- --> $DIR/copy-and-move-mixed.rs:16:19
+ --> $DIR/copy-and-move-mixed.rs:15:19
|
LL | let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
| ----------^^^^^^^^^^^^- --------------- move occurs because value has type `NC<C, NC<C, C>>`, which does not implement the `Copy` trait
| value moved here
error[E0382]: use of moved value
- --> $DIR/copy-and-move-mixed.rs:16:29
+ --> $DIR/copy-and-move-mixed.rs:15:29
|
LL | let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
| ----------^-
// this would create problems for the generalization aforementioned.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
fn main() {
struct NotCopy;
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/default-binding-modes-both-sides-independent.rs:10:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/default-binding-modes-both-sides-independent.rs:28:17
+ --> $DIR/default-binding-modes-both-sides-independent.rs:27:17
|
LL | let ref a @ b = NotCopy;
| --------^
| by-ref pattern here
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/default-binding-modes-both-sides-independent.rs:29:21
+ --> $DIR/default-binding-modes-both-sides-independent.rs:28:21
|
LL | let ref mut a @ b = NotCopy;
| ------------^
| by-ref pattern here
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/default-binding-modes-both-sides-independent.rs:31:20
+ --> $DIR/default-binding-modes-both-sides-independent.rs:30:20
|
LL | Ok(ref a @ b) | Err(ref a @ b) => {}
| --------^ --------^
| by-ref pattern here
error[E0009]: cannot bind by-move and by-ref in the same pattern
- --> $DIR/default-binding-modes-both-sides-independent.rs:35:17
+ --> $DIR/default-binding-modes-both-sides-independent.rs:34:17
|
LL | ref a @ b => {}
| --------^
// run-pass
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
struct A { a: u8, b: u8 }
+++ /dev/null
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/nested-patterns.rs:3:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
// not in the top position of a ascribing a let binding or function parameter.
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete
// This has no effect.
// We include it to demonstrate that this is the case:
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found `@`
- --> $DIR/nested-type-ascription-syntactically-invalid.rs:20:15
+ --> $DIR/nested-type-ascription-syntactically-invalid.rs:19:15
|
LL | let a: u8 @ b = 0;
| ^ expected one of 7 possible tokens
error: expected one of `)`, `,`, `@`, or `|`, found `:`
- --> $DIR/nested-type-ascription-syntactically-invalid.rs:26:15
+ --> $DIR/nested-type-ascription-syntactically-invalid.rs:25:15
|
LL | let a @ (b: u8);
| ^ expected one of `)`, `,`, `@`, or `|`
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found `)`
- --> $DIR/nested-type-ascription-syntactically-invalid.rs:26:19
+ --> $DIR/nested-type-ascription-syntactically-invalid.rs:25:19
|
LL | let a @ (b: u8);
| ^ expected one of 7 possible tokens
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found `@`
- --> $DIR/nested-type-ascription-syntactically-invalid.rs:33:15
+ --> $DIR/nested-type-ascription-syntactically-invalid.rs:32:15
|
LL | let a: T1 @ Outer(b: T2);
| ^ expected one of 7 possible tokens
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/nested-type-ascription-syntactically-invalid.rs:4:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
error: aborting due to 4 previous errors
// The code that is tested here lives in resolve (see `resolve_pattern_inner`).
#![feature(bindings_after_at)]
-//~^ WARN the feature `bindings_after_at` is incomplete and may cause the compiler to crash
#![feature(or_patterns)]
//~^ WARN the feature `or_patterns` is incomplete and may cause the compiler to crash
error[E0415]: identifier `a` is bound more than once in this parameter list
- --> $DIR/pat-at-same-name-both.rs:10:14
+ --> $DIR/pat-at-same-name-both.rs:9:14
|
LL | fn f(a @ a @ a: ()) {}
| ^ used as parameter more than once
error[E0415]: identifier `a` is bound more than once in this parameter list
- --> $DIR/pat-at-same-name-both.rs:10:18
+ --> $DIR/pat-at-same-name-both.rs:9:18
|
LL | fn f(a @ a @ a: ()) {}
| ^ used as parameter more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:15:20
+ --> $DIR/pat-at-same-name-both.rs:14:20
|
LL | Ok(a @ b @ a)
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:17:23
+ --> $DIR/pat-at-same-name-both.rs:16:23
|
LL | | Err(a @ b @ a)
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:22:13
+ --> $DIR/pat-at-same-name-both.rs:21:13
|
LL | let a @ a @ a = ();
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:22:17
+ --> $DIR/pat-at-same-name-both.rs:21:17
|
LL | let a @ a @ a = ();
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:25:21
+ --> $DIR/pat-at-same-name-both.rs:24:21
|
LL | let ref a @ ref a = ();
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:27:29
+ --> $DIR/pat-at-same-name-both.rs:26:29
|
LL | let ref mut a @ ref mut a = ();
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:30:17
+ --> $DIR/pat-at-same-name-both.rs:29:17
|
LL | let a @ (Ok(a) | Err(a)) = Ok(());
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:30:26
+ --> $DIR/pat-at-same-name-both.rs:29:26
|
LL | let a @ (Ok(a) | Err(a)) = Ok(());
| ^ used in a pattern more than once
-warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
- --> $DIR/pat-at-same-name-both.rs:4:12
- |
-LL | #![feature(bindings_after_at)]
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
-
warning: the feature `or_patterns` is incomplete and may cause the compiler to crash
- --> $DIR/pat-at-same-name-both.rs:6:12
+ --> $DIR/pat-at-same-name-both.rs:5:12
|
LL | #![feature(or_patterns)]
| ^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
error: aborting due to 10 previous errors