fork/rust

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

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
1.2 KiB33 linesraw
1error[E0038]: the trait `Bar` cannot be made into an object
2  --> $DIR/issue-19538.rs:17:15
3   |
4LL |     fn foo<T>(&self, val: T);
5   |        --- ...because method `foo` has generic type parameters
6...
7LL | trait Bar: Foo { }
8   |       --- this trait cannot be made into an object...
9...
10LL |     let test: &mut dyn Bar = &mut thing;
11   |               ^^^^^^^^^^^^ the trait `Bar` cannot be made into an object
12   |
13   = help: consider moving `foo` to another trait
14
15error[E0038]: the trait `Bar` cannot be made into an object
16  --> $DIR/issue-19538.rs:17:30
17   |
18LL |     fn foo<T>(&self, val: T);
19   |        --- ...because method `foo` has generic type parameters
20...
21LL | trait Bar: Foo { }
22   |       --- this trait cannot be made into an object...
23...
24LL |     let test: &mut dyn Bar = &mut thing;
25   |                              ^^^^^^^^^^ the trait `Bar` cannot be made into an object
26   |
27   = help: consider moving `foo` to another trait
28   = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&mut dyn Bar>` for `&mut Thing`
29   = note: required by cast to type `&mut dyn Bar`
30
31error: aborting due to 2 previous errors
32
33For more information about this error, try `rustc --explain E0038`.