fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
2.0 KiB48 linesraw
1error[E0107]: wrong number of type arguments: expected 0, found 1
2  --> $DIR/trait-test-2.rs:9:14
3   |
4LL |     10.dup::<i32>();
5   |              ^^^ unexpected type argument
6
7error[E0107]: wrong number of type arguments: expected 1, found 2
8  --> $DIR/trait-test-2.rs:10:20
9   |
10LL |     10.blah::<i32, i32>();
11   |                    ^^^ unexpected type argument
12
13error[E0038]: the trait `bar` cannot be made into an object
14  --> $DIR/trait-test-2.rs:11:16
15   |
16LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
17   |       ---                    ----     ---- ...because method `blah` has generic type parameters
18   |       |                      |
19   |       |                      ...because method `dup` references the `Self` type in its return type
20   |       this trait cannot be made into an object...
21...
22LL |     (box 10 as Box<dyn bar>).dup();
23   |                ^^^^^^^^^^^^ the trait `bar` cannot be made into an object
24   |
25   = help: consider moving `dup` to another trait
26   = help: consider moving `blah` to another trait
27
28error[E0038]: the trait `bar` cannot be made into an object
29  --> $DIR/trait-test-2.rs:11:6
30   |
31LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
32   |       ---                    ----     ---- ...because method `blah` has generic type parameters
33   |       |                      |
34   |       |                      ...because method `dup` references the `Self` type in its return type
35   |       this trait cannot be made into an object...
36...
37LL |     (box 10 as Box<dyn bar>).dup();
38   |      ^^^^^^ the trait `bar` cannot be made into an object
39   |
40   = help: consider moving `dup` to another trait
41   = help: consider moving `blah` to another trait
42   = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<dyn bar>>` for `std::boxed::Box<{integer}>`
43   = note: required by cast to type `std::boxed::Box<dyn bar>`
44
45error: aborting due to 4 previous errors
46
47Some errors have detailed explanations: E0038, E0107.
48For more information about an error, try `rustc --explain E0038`.