From f6d4720f26c92e9905c98b4ee2db832927e30a8a Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Sat, 8 Feb 2020 21:27:13 -0800 Subject: [PATCH 1/9] Make `u8::is_ascii` a stable `const fn` `char::is_ascii` is already a stable `const fn`, so there is no reason for `u8::is_ascii` to be unstable. --- src/libcore/num/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index ed37b48b3e8..81ef99e5b1c 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -4300,8 +4300,9 @@ impl u8 { /// assert!(!non_ascii.is_ascii()); /// ``` #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] + #[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.43.0")] #[inline] - pub fn is_ascii(&self) -> bool { + pub const fn is_ascii(&self) -> bool { *self & 128 == 0 } From bf732a11ecc319e0c0a840196bde1b5daccbdc85 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Sat, 8 Feb 2020 21:36:56 -0800 Subject: [PATCH 2/9] Test `u8::is_ascii` alongside `char::is_ascii` --- src/test/ui/consts/{std/char.rs => is_ascii.rs} | 6 ++++++ 1 file changed, 6 insertions(+) rename src/test/ui/consts/{std/char.rs => is_ascii.rs} (54%) diff --git a/src/test/ui/consts/std/char.rs b/src/test/ui/consts/is_ascii.rs similarity index 54% rename from src/test/ui/consts/std/char.rs rename to src/test/ui/consts/is_ascii.rs index fe79059a2e4..d8424549f93 100644 --- a/src/test/ui/consts/std/char.rs +++ b/src/test/ui/consts/is_ascii.rs @@ -3,7 +3,13 @@ static X: bool = 'a'.is_ascii(); static Y: bool = 'รค'.is_ascii(); +static BX: bool = b'a'.is_ascii(); +static BY: bool = 192u8.is_ascii(); + fn main() { assert!(X); assert!(!Y); + + assert!(BX); + assert!(!BY); } From ec980a21b06de1988afff7275bd8d4d44f73722c Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Thu, 20 Feb 2020 21:25:19 -0500 Subject: [PATCH 3/9] Add test for #69312 This bug was fixed by #67501. Closes #69312 --- src/test/ui/consts/issue-69312.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/test/ui/consts/issue-69312.rs diff --git a/src/test/ui/consts/issue-69312.rs b/src/test/ui/consts/issue-69312.rs new file mode 100644 index 00000000000..413c6752079 --- /dev/null +++ b/src/test/ui/consts/issue-69312.rs @@ -0,0 +1,10 @@ +// build-pass + +// Verify that the compiler doesn't ICE during const prop while evaluating the index operation. + +#![allow(unconditional_panic)] + +fn main() { + let cols = [0u32; 0]; + cols[0]; +} From c3303c7b086fef4d2571869fe6040ca9455c6e38 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 21 Feb 2020 13:31:21 +0100 Subject: [PATCH 4/9] Clean up E0323, E0324 and E0325 explanations --- src/librustc_error_codes/error_codes/E0323.md | 1 + src/librustc_error_codes/error_codes/E0324.md | 5 +++-- src/librustc_error_codes/error_codes/E0325.md | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0323.md b/src/librustc_error_codes/error_codes/E0323.md index 6d34c35f9cb..0bf42d17ebc 100644 --- a/src/librustc_error_codes/error_codes/E0323.md +++ b/src/librustc_error_codes/error_codes/E0323.md @@ -1,4 +1,5 @@ An associated const was implemented when another trait item was expected. + Erroneous code example: ```compile_fail,E0323 diff --git a/src/librustc_error_codes/error_codes/E0324.md b/src/librustc_error_codes/error_codes/E0324.md index b8c9e596990..1442cb77dd9 100644 --- a/src/librustc_error_codes/error_codes/E0324.md +++ b/src/librustc_error_codes/error_codes/E0324.md @@ -1,5 +1,6 @@ -A method was implemented when another trait item was expected. Erroneous -code example: +A method was implemented when another trait item was expected. + +Erroneous code example: ```compile_fail,E0324 struct Bar; diff --git a/src/librustc_error_codes/error_codes/E0325.md b/src/librustc_error_codes/error_codes/E0325.md index f685b92cbf0..656fd1ec82b 100644 --- a/src/librustc_error_codes/error_codes/E0325.md +++ b/src/librustc_error_codes/error_codes/E0325.md @@ -1,4 +1,5 @@ An associated type was implemented when another trait item was expected. + Erroneous code example: ```compile_fail,E0325 From 8f3fcec351fcc24aba462f200c60dd712592b64d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 21 Feb 2020 13:32:04 +0100 Subject: [PATCH 5/9] Clean up E0326 explanation --- src/librustc_error_codes/error_codes/E0326.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0326.md b/src/librustc_error_codes/error_codes/E0326.md index 0702d00c2de..3d357819c7f 100644 --- a/src/librustc_error_codes/error_codes/E0326.md +++ b/src/librustc_error_codes/error_codes/E0326.md @@ -1,7 +1,6 @@ -The types of any associated constants in a trait implementation must match the -types in the trait definition. This error indicates that there was a mismatch. +An implementation of a trait doesn't match the type contraint. -Here's an example of this error: +Erroneous code example: ```compile_fail,E0326 trait Foo { @@ -14,3 +13,6 @@ impl Foo for Bar { const BAR: u32 = 5; // error, expected bool, found u32 } ``` + +The types of any associated constants in a trait implementation must match the +types in the trait definition. From 8893607a54180f77b85a65d428da6954114844fd Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 21 Feb 2020 11:03:21 -0300 Subject: [PATCH 6/9] MIR is not an experiment anymore --- src/librustc_mir/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 4f1b90e34cf..284dd74ce99 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -1,6 +1,6 @@ /*! -Rust MIR: a lowered representation of Rust. Also: an experiment! +Rust MIR: a lowered representation of Rust. */ From e1c8c8cf63b48c798c1954749e58e99c6cc50093 Mon Sep 17 00:00:00 2001 From: Michael Mc Donnell Date: Thu, 20 Feb 2020 16:01:08 -0800 Subject: [PATCH 7/9] Test `Duration::new` panics on overflow A `Duration` is created from a second and nanoseconds variable. The documentation says: "This constructor will panic if the carry from the nanoseconds overflows the seconds counter". This was, however, not tested in the tests. I doubt the behavior will ever regress, but it is usually a good idea to test all documented behavior. --- src/libcore/tests/time.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libcore/tests/time.rs b/src/libcore/tests/time.rs index 273f1258bb0..c1fbdf7df76 100644 --- a/src/libcore/tests/time.rs +++ b/src/libcore/tests/time.rs @@ -11,6 +11,12 @@ fn creation() { assert_eq!(Duration::from_millis(4000), Duration::new(4, 0)); } +#[test] +#[should_panic] +fn new_overflow() { + let _ = Duration::new(::core::u64::MAX, 1_000_000_000); +} + #[test] fn secs() { assert_eq!(Duration::new(0, 0).as_secs(), 0); From 38a22b8130f6466352bca53d5020c44cd648326a Mon Sep 17 00:00:00 2001 From: LeSeulArtichaut Date: Fri, 21 Feb 2020 14:49:51 +0100 Subject: [PATCH 8/9] Fix error message Bless tests --- .../hair/pattern/check_match.rs | 2 +- ...can-live-while-the-other-survives-1.stderr | 4 +- ...t-by-move-and-ref-inverse-promotion.stderr | 2 +- ...orrowck-pat-by-move-and-ref-inverse.stderr | 50 +++++++++---------- .../borrowck-pat-ref-mut-twice.stderr | 8 +-- ...inding-modes-both-sides-independent.stderr | 2 +- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/librustc_mir_build/hair/pattern/check_match.rs b/src/librustc_mir_build/hair/pattern/check_match.rs index 651f2f70d9b..3dfe826ad2a 100644 --- a/src/librustc_mir_build/hair/pattern/check_match.rs +++ b/src/librustc_mir_build/hair/pattern/check_match.rs @@ -659,7 +659,7 @@ fn check_borrow_conflicts_in_at_patterns(cx: &MatchVisitor<'_, '_>, pat: &Pat<'_ }); if !conflicts_ref.is_empty() { let occurs_because = format!( - "move occurs because `{}` has type `{}` which does implement the `Copy` trait", + "move occurs because `{}` has type `{}` which does not implement the `Copy` trait", name, tables.node_type(pat.hir_id), ); diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr index 026747c212a..f2186b9298e 100644 --- a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr +++ b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr @@ -15,7 +15,7 @@ LL | Some(_z @ ref _y) => {} | | | | | value borrowed here after move | value moved into `_z` here - | move occurs because `_z` has type `X` which does implement the `Copy` trait + | move occurs because `_z` has type `X` which does not implement the `Copy` trait error: cannot move out of value because it is borrowed --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:29:14 @@ -34,7 +34,7 @@ LL | Some(_z @ ref mut _y) => {} | | | | | value borrowed here after move | value moved into `_z` here - | move occurs because `_z` has type `X` which does implement the `Copy` trait + | move occurs because `_z` 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:21:19 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 91fdfd4f2ab..54900e958c2 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 implement the `Copy` trait + | move occurs because `a` has type `main::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 ec86692dc69..f819e671436 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 implement the `Copy` trait + | move occurs because `a` has type `main::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 implement the `Copy` trait + | move occurs because `a` has type `(main::U, main::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 implement the `Copy` trait + | move occurs because `b` has type `main::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 implement the `Copy` trait + | move occurs because `d` has type `main::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 implement the `Copy` trait + | move occurs because `a` has type `[main::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 implement the `Copy` trait + | move occurs because `a` has type `main::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 implement the `Copy` trait + | move occurs because `a` has type `(main::U, main::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 implement the `Copy` trait + | move occurs because `b` has type `main::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 implement the `Copy` trait + | move occurs because `d` has type `main::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 implement the `Copy` trait + | move occurs because `a` has type `[main::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` which does implement the `Copy` trait + | move occurs because `a` has type `std::option::Option` 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 implement the `Copy` trait + | move occurs because `a` has type `std::option::Option<(main::U, main::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 implement the `Copy` trait + | move occurs because `b` has type `main::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 implement the `Copy` trait + | move occurs because `d` has type `main::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 implement the `Copy` trait + | move occurs because `a` has type `std::option::Option<[main::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` which does implement the `Copy` trait + | move occurs because `a` has type `std::option::Option` 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 implement the `Copy` trait + | move occurs because `a` has type `std::option::Option<(main::U, main::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 implement the `Copy` trait + | move occurs because `b` has type `main::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 implement the `Copy` trait + | move occurs because `d` has type `main::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 implement the `Copy` trait + | move occurs because `a` has type `std::option::Option<[main::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 implement the `Copy` trait + | move occurs because `a` has type `main::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 implement the `Copy` trait + | move occurs because `a` has type `(main::U, main::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 implement the `Copy` trait + | move occurs because `b` has type `main::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 implement the `Copy` trait + | move occurs because `d` has type `main::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 implement the `Copy` trait + | move occurs because `a` has type `[main::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 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 4e96c6e1669..e74f227b5e4 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 implement the `Copy` trait + | move occurs because `a` has type `(main::U, main::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 implement the `Copy` trait + | move occurs because `a` has type `&mut (main::U, [main::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 implement the `Copy` trait + | move occurs because `a` has type `&mut main::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 implement the `Copy` trait + | move occurs because `a` has type `&mut (main::U, main::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 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 697a8b96e63..19e815a1ae8 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 implement the `Copy` trait + | move occurs because `b` has type `main::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 From 88d6ab84c94dceebeb21cf98eef7e3e89acb69c7 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 22 Feb 2020 12:24:05 +0100 Subject: [PATCH 9/9] move const_eval.rs into the module folder --- src/librustc_mir/{const_eval.rs => const_eval/mod.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/librustc_mir/{const_eval.rs => const_eval/mod.rs} (100%) diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval/mod.rs similarity index 100% rename from src/librustc_mir/const_eval.rs rename to src/librustc_mir/const_eval/mod.rs