summary refs log tree commit diff
path: root/src/test/ui/traits/trait-test-2.stderr
blob: 9d1eef547568eb547b2e896b4a1e8874f4f55583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
error[E0107]: wrong number of type arguments: expected 0, found 1
  --> $DIR/trait-test-2.rs:9:14
   |
LL |     10.dup::<i32>();
   |              ^^^ unexpected type argument

error[E0107]: wrong number of type arguments: expected 1, found 2
  --> $DIR/trait-test-2.rs:10:20
   |
LL |     10.blah::<i32, i32>();
   |                    ^^^ unexpected type argument

error[E0038]: the trait `bar` cannot be made into an object
  --> $DIR/trait-test-2.rs:11:16
   |
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
   |       ---                    ----     ---- ...because method `blah` has generic type parameters
   |       |                      |
   |       |                      ...because method `dup` references the `Self` type in its return type
   |       this trait cannot be made into an object...
...
LL |     (box 10 as Box<dyn bar>).dup();
   |                ^^^^^^^^^^^^ the trait `bar` cannot be made into an object
   |
   = help: consider moving `dup` to another trait
   = help: consider moving `blah` to another trait

error[E0038]: the trait `bar` cannot be made into an object
  --> $DIR/trait-test-2.rs:11:6
   |
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
   |       ---                    ----     ---- ...because method `blah` has generic type parameters
   |       |                      |
   |       |                      ...because method `dup` references the `Self` type in its return type
   |       this trait cannot be made into an object...
...
LL |     (box 10 as Box<dyn bar>).dup();
   |      ^^^^^^ the trait `bar` cannot be made into an object
   |
   = help: consider moving `dup` to another trait
   = help: consider moving `blah` to another trait
   = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<dyn bar>>` for `std::boxed::Box<{integer}>`
   = note: required by cast to type `std::boxed::Box<dyn bar>`

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0038, E0107.
For more information about an error, try `rustc --explain E0038`.