]> git.lizzy.rs Git - rust.git/commitdiff
use gathered body_owners in par_body_owners
authorMiguel Guarniz <mi9uel9@gmail.com>
Wed, 22 Jun 2022 23:12:18 +0000 (19:12 -0400)
committerMiguel Guarniz <mi9uel9@gmail.com>
Wed, 13 Jul 2022 16:22:25 +0000 (12:22 -0400)
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
12 files changed:
compiler/rustc_middle/src/hir/map/mod.rs
src/test/ui/asm/type-check-1.stderr
src/test/ui/const-generics/const-arg-in-const-arg.full.stderr
src/test/ui/const-generics/const-arg-in-const-arg.min.stderr
src/test/ui/issues/issue-47486.stderr
src/test/ui/moves/use_of_moved_value_copy_suggestions.stderr
src/test/ui/proc-macro/attribute-with-error.stderr
src/test/ui/repeat-expr/repeat_count.stderr
src/test/ui/suggestions/impl-trait-with-missing-bounds.stderr
src/test/ui/suggestions/suggest-ref-macro.stderr
src/test/ui/union/union-derive-clone.mirunsafeck.stderr
src/test/ui/union/union-derive-clone.thirunsafeck.stderr

index ff71d16f83b36077a4972f9234754f709e56ea33..eef639e1589d77d00fb6be58fcc05a2ad3a136a7 100644 (file)
@@ -498,19 +498,8 @@ pub fn body_owners(self) -> impl Iterator<Item = LocalDefId> + 'hir {
 
     pub fn par_body_owners<F: Fn(LocalDefId) + Sync + Send>(self, f: F) {
         use rustc_data_structures::sync::{par_iter, ParallelIterator};
-        #[cfg(parallel_compiler)]
-        use rustc_rayon::iter::IndexedParallelIterator;
-
-        par_iter(&self.krate().owners.raw).enumerate().for_each(|(owner, owner_info)| {
-            let owner = LocalDefId::new(owner);
-            if let MaybeOwner::Owner(owner_info) = owner_info {
-                par_iter(owner_info.nodes.bodies.range(..)).for_each(|(local_id, _)| {
-                    let hir_id = HirId { owner, local_id: *local_id };
-                    let body_id = BodyId { hir_id };
-                    f(self.body_owner_def_id(body_id))
-                })
-            }
-        });
+
+        par_iter(&self.tcx.hir_crate_items(()).body_owners[..]).for_each(|&def_id| f(def_id));
     }
 
     pub fn ty_param_owner(self, def_id: LocalDefId) -> LocalDefId {
index 5a997b47d73eb5d9e6fd1b2abd59ecdf273d3d5c..162ff1d32bc44b486fc8f0b41e82cc8998e7faef 100644 (file)
@@ -33,33 +33,6 @@ LL |         asm!("{}", sym x);
    |
    = help: `sym` operands must refer to either a function or a static
 
-error[E0308]: mismatched types
-  --> $DIR/type-check-1.rs:58:26
-   |
-LL |         asm!("{}", const 0f32);
-   |                          ^^^^ expected integer, found `f32`
-
-error[E0308]: mismatched types
-  --> $DIR/type-check-1.rs:60:26
-   |
-LL |         asm!("{}", const 0 as *mut u8);
-   |                          ^^^^^^^^^^^^ expected integer, found *-ptr
-   |
-   = note:     expected type `{integer}`
-           found raw pointer `*mut u8`
-
-error[E0308]: mismatched types
-  --> $DIR/type-check-1.rs:62:26
-   |
-LL |         asm!("{}", const &0);
-   |                          ^^ expected integer, found `&{integer}`
-   |
-help: consider removing the borrow
-   |
-LL -         asm!("{}", const &0);
-LL +         asm!("{}", const 0);
-   |
-
 error: invalid asm output
   --> $DIR/type-check-1.rs:15:29
    |
@@ -123,6 +96,33 @@ LL |         asm!("{}", inout(reg) v[..]);
    |
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
+error[E0308]: mismatched types
+  --> $DIR/type-check-1.rs:58:26
+   |
+LL |         asm!("{}", const 0f32);
+   |                          ^^^^ expected integer, found `f32`
+
+error[E0308]: mismatched types
+  --> $DIR/type-check-1.rs:60:26
+   |
+LL |         asm!("{}", const 0 as *mut u8);
+   |                          ^^^^^^^^^^^^ expected integer, found *-ptr
+   |
+   = note:     expected type `{integer}`
+           found raw pointer `*mut u8`
+
+error[E0308]: mismatched types
+  --> $DIR/type-check-1.rs:62:26
+   |
+LL |         asm!("{}", const &0);
+   |                          ^^ expected integer, found `&{integer}`
+   |
+help: consider removing the borrow
+   |
+LL -         asm!("{}", const &0);
+LL +         asm!("{}", const 0);
+   |
+
 error[E0308]: mismatched types
   --> $DIR/type-check-1.rs:76:25
    |
index dbbdb2a0ce3311fba5e7b5d0a3cd44d94705862a..8672e79b3e8c8afd5a0b9e7c2ccd0e1a345c693e 100644 (file)
@@ -22,30 +22,6 @@ note: the late bound lifetime parameter is introduced here
 LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
    |              ^^
 
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
-  --> $DIR/const-arg-in-const-arg.rs:30:23
-   |
-LL |     let _ = [0; faz::<'a>(&())];
-   |                       ^^
-   |
-note: the late bound lifetime parameter is introduced here
-  --> $DIR/const-arg-in-const-arg.rs:8:14
-   |
-LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
-   |              ^^
-
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
-  --> $DIR/const-arg-in-const-arg.rs:33:23
-   |
-LL |     let _ = [0; faz::<'b>(&())];
-   |                       ^^
-   |
-note: the late bound lifetime parameter is introduced here
-  --> $DIR/const-arg-in-const-arg.rs:8:14
-   |
-LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
-   |              ^^
-
 error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
   --> $DIR/const-arg-in-const-arg.rs:41:24
    |
@@ -118,6 +94,30 @@ LL |     let _ = [0; bar::<N>()];
    |
    = help: try adding a `where` bound using this expression: `where [(); bar::<N>()]:`
 
+error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+  --> $DIR/const-arg-in-const-arg.rs:30:23
+   |
+LL |     let _ = [0; faz::<'a>(&())];
+   |                       ^^
+   |
+note: the late bound lifetime parameter is introduced here
+  --> $DIR/const-arg-in-const-arg.rs:8:14
+   |
+LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
+   |              ^^
+
+error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+  --> $DIR/const-arg-in-const-arg.rs:33:23
+   |
+LL |     let _ = [0; faz::<'b>(&())];
+   |                       ^^
+   |
+note: the late bound lifetime parameter is introduced here
+  --> $DIR/const-arg-in-const-arg.rs:8:14
+   |
+LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
+   |              ^^
+
 error: unconstrained generic constant
   --> $DIR/const-arg-in-const-arg.rs:47:19
    |
index 6ca9a2a48592ce85e75d364ff68d6f878e7040ae..f1353aa99437de05d6668c311ed3ec4b693e5be3 100644 (file)
@@ -241,21 +241,21 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
    |              ^^
 
 error[E0747]: unresolved item provided when a constant was expected
-  --> $DIR/const-arg-in-const-arg.rs:27:23
+  --> $DIR/const-arg-in-const-arg.rs:38:24
    |
-LL |     let _ = [0; bar::<N>()];
-   |                       ^
+LL |     let _: Foo<{ bar::<N>() }>;
+   |                        ^
    |
 help: if this generic argument was intended as a const parameter, surround it with braces
    |
-LL |     let _ = [0; bar::<{ N }>()];
-   |                       +   +
+LL |     let _: Foo<{ bar::<{ N }>() }>;
+   |                        +   +
 
 error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
-  --> $DIR/const-arg-in-const-arg.rs:30:23
+  --> $DIR/const-arg-in-const-arg.rs:41:24
    |
-LL |     let _ = [0; faz::<'a>(&())];
-   |                       ^^
+LL |     let _: Foo<{ faz::<'a>(&()) }>;
+   |                        ^^
    |
 note: the late bound lifetime parameter is introduced here
   --> $DIR/const-arg-in-const-arg.rs:8:14
@@ -264,10 +264,10 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
    |              ^^
 
 error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
-  --> $DIR/const-arg-in-const-arg.rs:33:23
+  --> $DIR/const-arg-in-const-arg.rs:44:24
    |
-LL |     let _ = [0; faz::<'b>(&())];
-   |                       ^^
+LL |     let _: Foo<{ faz::<'b>(&()) }>;
+   |                        ^^
    |
 note: the late bound lifetime parameter is introduced here
   --> $DIR/const-arg-in-const-arg.rs:8:14
@@ -275,22 +275,30 @@ note: the late bound lifetime parameter is introduced here
 LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
    |              ^^
 
+error: constant expression depends on a generic parameter
+  --> $DIR/const-arg-in-const-arg.rs:25:17
+   |
+LL |     let _ = [0; foo::<T>()];
+   |                 ^^^^^^^^^^
+   |
+   = note: this may fail depending on what value the parameter takes
+
 error[E0747]: unresolved item provided when a constant was expected
-  --> $DIR/const-arg-in-const-arg.rs:38:24
+  --> $DIR/const-arg-in-const-arg.rs:27:23
    |
-LL |     let _: Foo<{ bar::<N>() }>;
-   |                        ^
+LL |     let _ = [0; bar::<N>()];
+   |                       ^
    |
 help: if this generic argument was intended as a const parameter, surround it with braces
    |
-LL |     let _: Foo<{ bar::<{ N }>() }>;
-   |                        +   +
+LL |     let _ = [0; bar::<{ N }>()];
+   |                       +   +
 
 error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
-  --> $DIR/const-arg-in-const-arg.rs:41:24
+  --> $DIR/const-arg-in-const-arg.rs:30:23
    |
-LL |     let _: Foo<{ faz::<'a>(&()) }>;
-   |                        ^^
+LL |     let _ = [0; faz::<'a>(&())];
+   |                       ^^
    |
 note: the late bound lifetime parameter is introduced here
   --> $DIR/const-arg-in-const-arg.rs:8:14
@@ -299,10 +307,10 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
    |              ^^
 
 error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
-  --> $DIR/const-arg-in-const-arg.rs:44:24
+  --> $DIR/const-arg-in-const-arg.rs:33:23
    |
-LL |     let _: Foo<{ faz::<'b>(&()) }>;
-   |                        ^^
+LL |     let _ = [0; faz::<'b>(&())];
+   |                       ^^
    |
 note: the late bound lifetime parameter is introduced here
   --> $DIR/const-arg-in-const-arg.rs:8:14
@@ -310,14 +318,6 @@ note: the late bound lifetime parameter is introduced here
 LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
    |              ^^
 
-error: constant expression depends on a generic parameter
-  --> $DIR/const-arg-in-const-arg.rs:25:17
-   |
-LL |     let _ = [0; foo::<T>()];
-   |                 ^^^^^^^^^^
-   |
-   = note: this may fail depending on what value the parameter takes
-
 error[E0747]: unresolved item provided when a constant was expected
   --> $DIR/const-arg-in-const-arg.rs:49:27
    |
index ca57b2d7e01d212c76ee02a09bbab791de9e25b7..b45f57b7b846bdcf8d90d94336464d506b96c999 100644 (file)
@@ -1,3 +1,9 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-47486.rs:2:10
+   |
+LL |     () < std::mem::size_of::<_>();
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize`
+
 error[E0282]: type annotations needed
   --> $DIR/issue-47486.rs:3:11
    |
@@ -9,12 +15,6 @@ help: consider specifying the generic argument
 LL |     [0u8; std::mem::size_of::<_>()];
    |                            ~~~~~
 
-error[E0308]: mismatched types
-  --> $DIR/issue-47486.rs:2:10
-   |
-LL |     () < std::mem::size_of::<_>();
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize`
-
 error: aborting due to 2 previous errors
 
 Some errors have detailed explanations: E0282, E0308.
index 5a84e3b81a6565e7de14817cb7fbf6dea2fdebf0..3e37fcb2141fc57f36d004a864af1291eb7a0e8c 100644 (file)
@@ -143,36 +143,36 @@ LL | fn duplicate_custom_4<T: A + Copy + Trait>(t: S<T>) -> (S<T>, S<T>)
    |                            ++++++++++++++
 
 error[E0382]: use of moved value: `t`
-  --> $DIR/use_of_moved_value_copy_suggestions.rs:83:9
+  --> $DIR/use_of_moved_value_copy_suggestions.rs:75:9
    |
-LL | fn existing_colon_in_where<T>(t: T)
-   |                               - move occurs because `t` has type `T`, which does not implement the `Copy` trait
-...
+LL | fn existing_colon<T:>(t: T) {
+   |                       - move occurs because `t` has type `T`, which does not implement the `Copy` trait
+LL |
 LL |     [t, t];
    |      -  ^ value used here after move
    |      |
    |      value moved here
    |
-help: consider further restricting type parameter `T`
+help: consider restricting type parameter `T`
    |
-LL |     T:, T: Copy
-   |       ~~~~~~~~~
+LL | fn existing_colon<T: Copy>(t: T) {
+   |                      ++++
 
 error[E0382]: use of moved value: `t`
-  --> $DIR/use_of_moved_value_copy_suggestions.rs:75:9
+  --> $DIR/use_of_moved_value_copy_suggestions.rs:83:9
    |
-LL | fn existing_colon<T:>(t: T) {
-   |                       - move occurs because `t` has type `T`, which does not implement the `Copy` trait
-LL |
+LL | fn existing_colon_in_where<T>(t: T)
+   |                               - move occurs because `t` has type `T`, which does not implement the `Copy` trait
+...
 LL |     [t, t];
    |      -  ^ value used here after move
    |      |
    |      value moved here
    |
-help: consider restricting type parameter `T`
+help: consider further restricting type parameter `T`
    |
-LL | fn existing_colon<T: Copy>(t: T) {
-   |                      ++++
+LL |     T:, T: Copy
+   |       ~~~~~~~~~
 
 error: aborting due to 11 previous errors
 
index 127c49957c1e55b3032a14cc937d70113c57370c..7f3a7e670b9b75b8c5727f55502d9b03c985a8a1 100644 (file)
@@ -1,11 +1,3 @@
-error[E0308]: mismatched types
-  --> $DIR/attribute-with-error.rs:25:22
-   |
-LL |         let a: i32 = "foo";
-   |                ---   ^^^^^ expected `i32`, found `&str`
-   |                |
-   |                expected due to this
-
 error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:10:18
    |
@@ -22,6 +14,14 @@ LL |     let b: i32 = "f'oo";
    |            |
    |            expected due to this
 
+error[E0308]: mismatched types
+  --> $DIR/attribute-with-error.rs:25:22
+   |
+LL |         let a: i32 = "foo";
+   |                ---   ^^^^^ expected `i32`, found `&str`
+   |                |
+   |                expected due to this
+
 error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:35:22
    |
index 59bcd954a1fde235c20e3c4d83b06e7dd7feca44..e222c141f8b6a0b184d35a5509d61c96911bf536 100644 (file)
@@ -30,6 +30,12 @@ error[E0308]: mismatched types
 LL |     let e = [0; "foo"];
    |                 ^^^^^ expected `usize`, found `&str`
 
+error[E0308]: mismatched types
+  --> $DIR/repeat_count.rs:31:17
+   |
+LL |     let g = [0; G { g: () }];
+   |                 ^^^^^^^^^^^ expected `usize`, found struct `G`
+
 error[E0308]: mismatched types
   --> $DIR/repeat_count.rs:19:17
    |
@@ -57,12 +63,6 @@ help: change the type of the numeric literal from `u8` to `usize`
 LL |     let f = [0; 4usize];
    |                  ~~~~~
 
-error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:31:17
-   |
-LL |     let g = [0; G { g: () }];
-   |                 ^^^^^^^^^^^ expected `usize`, found struct `G`
-
 error: aborting due to 9 previous errors
 
 Some errors have detailed explanations: E0308, E0435.
index 229c4b824f27578726d12947fb1474e77c0ae3f4..a763eb6f2f85499ef5c44377636834e872e3c1c7 100644 (file)
@@ -1,3 +1,22 @@
+error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
+  --> $DIR/impl-trait-with-missing-bounds.rs:6:13
+   |
+LL |         qux(constraint);
+   |         --- ^^^^^^^^^^ `<impl Iterator as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+   |         |
+   |         required by a bound introduced by this call
+   |
+   = help: the trait `Debug` is not implemented for `<impl Iterator as Iterator>::Item`
+note: required by a bound in `qux`
+  --> $DIR/impl-trait-with-missing-bounds.rs:50:16
+   |
+LL | fn qux(_: impl std::fmt::Debug) {}
+   |                ^^^^^^^^^^^^^^^ required by this bound in `qux`
+help: introduce a type parameter with a trait bound instead of using `impl Trait`
+   |
+LL | fn foo<I: Iterator>(constraints: I) where <I as Iterator>::Item: Debug {
+   |       +++++++++++++              ~  ++++++++++++++++++++++++++++++++++
+
 error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
   --> $DIR/impl-trait-with-missing-bounds.rs:14:13
    |
@@ -74,25 +93,6 @@ help: introduce a type parameter with a trait bound instead of using `impl Trait
 LL | fn bak<I: Iterator + std::fmt::Debug>(constraints: I) where <I as Iterator>::Item: Debug {
    |       +++++++++++++++++++++++++++++++              ~  ++++++++++++++++++++++++++++++++++
 
-error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
-  --> $DIR/impl-trait-with-missing-bounds.rs:6:13
-   |
-LL |         qux(constraint);
-   |         --- ^^^^^^^^^^ `<impl Iterator as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
-   |         |
-   |         required by a bound introduced by this call
-   |
-   = help: the trait `Debug` is not implemented for `<impl Iterator as Iterator>::Item`
-note: required by a bound in `qux`
-  --> $DIR/impl-trait-with-missing-bounds.rs:50:16
-   |
-LL | fn qux(_: impl std::fmt::Debug) {}
-   |                ^^^^^^^^^^^^^^^ required by this bound in `qux`
-help: introduce a type parameter with a trait bound instead of using `impl Trait`
-   |
-LL | fn foo<I: Iterator>(constraints: I) where <I as Iterator>::Item: Debug {
-   |       +++++++++++++              ~  ++++++++++++++++++++++++++++++++++
-
 error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
   --> $DIR/impl-trait-with-missing-bounds.rs:45:13
    |
index b0ac770c06f0fcc295a3687835cbfee208adcf8d..84cbc93571a710f4b8cbafe39bf245fb647a9dd6 100644 (file)
@@ -1,3 +1,25 @@
+error[E0308]: mismatched types
+  --> $DIR/suggest-ref-macro.rs:8:1
+   |
+LL | #[hello]
+   | ^^^^^^^^
+   | |
+   | expected `&mut i32`, found integer
+   | arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/suggest-ref-macro.rs:8:1
+   |
+LL |   #[hello]
+   |  _-^^^^^^^
+LL | | fn abc() {}
+LL | |
+LL | | fn x(_: &mut i32) {}
+LL | |
+LL | | macro_rules! bla {
+   | |_____________-
+   = note: this error originates in the attribute macro `hello` (in Nightly builds, run with -Z macro-backtrace for more info)
+
 error[E0308]: mismatched types
   --> $DIR/suggest-ref-macro.rs:15:11
    |
@@ -36,28 +58,6 @@ note: function defined here
 LL | fn x(_: &mut i32) {}
    |    ^ -----------
 
-error[E0308]: mismatched types
-  --> $DIR/suggest-ref-macro.rs:8:1
-   |
-LL | #[hello]
-   | ^^^^^^^^
-   | |
-   | expected `&mut i32`, found integer
-   | arguments to this function are incorrect
-   |
-note: function defined here
-  --> $DIR/suggest-ref-macro.rs:8:1
-   |
-LL |   #[hello]
-   |  _-^^^^^^^
-LL | | fn abc() {}
-LL | |
-LL | | fn x(_: &mut i32) {}
-LL | |
-LL | | macro_rules! bla {
-   | |_____________-
-   = note: this error originates in the attribute macro `hello` (in Nightly builds, run with -Z macro-backtrace for more info)
-
 error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
index c242a7de7abfb6959212bfa7cc74050e34abcfcf..11650a28563cd190d19464b5cd6a551192482327 100644 (file)
@@ -1,3 +1,20 @@
+error[E0277]: the trait bound `U1: Copy` is not satisfied
+  --> $DIR/union-derive-clone.rs:6:10
+   |
+LL | #[derive(Clone)]
+   |          ^^^^^ the trait `Copy` is not implemented for `U1`
+   |
+note: required by a bound in `AssertParamIsCopy`
+  --> $SRC_DIR/core/src/clone.rs:LL:COL
+   |
+LL | pub struct AssertParamIsCopy<T: Copy + ?Sized> {
+   |                                 ^^^^ required by this bound in `AssertParamIsCopy`
+   = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider annotating `U1` with `#[derive(Copy)]`
+   |
+LL | #[derive(Copy)]
+   |
+
 error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied
   --> $DIR/union-derive-clone.rs:38:15
    |
@@ -26,23 +43,6 @@ help: consider annotating `CloneNoCopy` with `#[derive(Clone, Copy)]`
 LL | #[derive(Clone, Copy)]
    |
 
-error[E0277]: the trait bound `U1: Copy` is not satisfied
-  --> $DIR/union-derive-clone.rs:6:10
-   |
-LL | #[derive(Clone)]
-   |          ^^^^^ the trait `Copy` is not implemented for `U1`
-   |
-note: required by a bound in `AssertParamIsCopy`
-  --> $SRC_DIR/core/src/clone.rs:LL:COL
-   |
-LL | pub struct AssertParamIsCopy<T: Copy + ?Sized> {
-   |                                 ^^^^ required by this bound in `AssertParamIsCopy`
-   = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: consider annotating `U1` with `#[derive(Copy)]`
-   |
-LL | #[derive(Copy)]
-   |
-
 error: aborting due to 2 previous errors
 
 Some errors have detailed explanations: E0277, E0599.
index c242a7de7abfb6959212bfa7cc74050e34abcfcf..11650a28563cd190d19464b5cd6a551192482327 100644 (file)
@@ -1,3 +1,20 @@
+error[E0277]: the trait bound `U1: Copy` is not satisfied
+  --> $DIR/union-derive-clone.rs:6:10
+   |
+LL | #[derive(Clone)]
+   |          ^^^^^ the trait `Copy` is not implemented for `U1`
+   |
+note: required by a bound in `AssertParamIsCopy`
+  --> $SRC_DIR/core/src/clone.rs:LL:COL
+   |
+LL | pub struct AssertParamIsCopy<T: Copy + ?Sized> {
+   |                                 ^^^^ required by this bound in `AssertParamIsCopy`
+   = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider annotating `U1` with `#[derive(Copy)]`
+   |
+LL | #[derive(Copy)]
+   |
+
 error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied
   --> $DIR/union-derive-clone.rs:38:15
    |
@@ -26,23 +43,6 @@ help: consider annotating `CloneNoCopy` with `#[derive(Clone, Copy)]`
 LL | #[derive(Clone, Copy)]
    |
 
-error[E0277]: the trait bound `U1: Copy` is not satisfied
-  --> $DIR/union-derive-clone.rs:6:10
-   |
-LL | #[derive(Clone)]
-   |          ^^^^^ the trait `Copy` is not implemented for `U1`
-   |
-note: required by a bound in `AssertParamIsCopy`
-  --> $SRC_DIR/core/src/clone.rs:LL:COL
-   |
-LL | pub struct AssertParamIsCopy<T: Copy + ?Sized> {
-   |                                 ^^^^ required by this bound in `AssertParamIsCopy`
-   = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: consider annotating `U1` with `#[derive(Copy)]`
-   |
-LL | #[derive(Copy)]
-   |
-
 error: aborting due to 2 previous errors
 
 Some errors have detailed explanations: E0277, E0599.