fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
1.6 KiB35 linesraw
1error[E0225]: only auto traits can be used as additional traits in a trait object
2  --> $DIR/issue-32963.rs:8:31
3   |
4LL |     size_of_copy::<dyn Misc + Copy>();
5   |                        ----   ^^^^
6   |                        |      |
7   |                        |      additional non-auto trait
8   |                        |      trait alias used in trait object type (additional use)
9   |                        first non-auto trait
10   |                        trait alias used in trait object type (first use)
11
12error[E0225]: only auto traits can be used as additional traits in a trait object
13  --> $DIR/issue-32963.rs:8:31
14   |
15LL |     size_of_copy::<dyn Misc + Copy>();
16   |                        ----   ^^^^
17   |                        |      |
18   |                        |      additional non-auto trait
19   |                        |      trait alias used in trait object type (additional use)
20   |                        first non-auto trait
21   |                        trait alias used in trait object type (first use)
22
23error[E0277]: the trait bound `dyn Misc: std::marker::Copy` is not satisfied
24  --> $DIR/issue-32963.rs:8:5
25   |
26LL | fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
27   |    ------------    ---- required by this bound in `size_of_copy`
28...
29LL |     size_of_copy::<dyn Misc + Copy>();
30   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `dyn Misc`
31
32error: aborting due to 3 previous errors
33
34Some errors have detailed explanations: E0225, E0277.
35For more information about an error, try `rustc --explain E0225`.