]> git.proxmox.com Git - rustc.git/blob - src/test/ui/object-safety/issue-19538.stderr
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / object-safety / issue-19538.stderr
1 error[E0038]: the trait `Bar` cannot be made into an object
2 --> $DIR/issue-19538.rs:17:15
3 |
4 LL | let test: &mut dyn Bar = &mut thing;
5 | ^^^^^^^^^^^^ `Bar` cannot be made into an object
6 |
7 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
8 --> $DIR/issue-19538.rs:2:8
9 |
10 LL | fn foo<T>(&self, val: T);
11 | ^^^ ...because method `foo` has generic type parameters
12 ...
13 LL | trait Bar: Foo { }
14 | --- this trait cannot be made into an object...
15 = help: consider moving `foo` to another trait
16
17 error[E0038]: the trait `Bar` cannot be made into an object
18 --> $DIR/issue-19538.rs:17:30
19 |
20 LL | let test: &mut dyn Bar = &mut thing;
21 | ^^^^^^^^^^ `Bar` cannot be made into an object
22 |
23 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
24 --> $DIR/issue-19538.rs:2:8
25 |
26 LL | fn foo<T>(&self, val: T);
27 | ^^^ ...because method `foo` has generic type parameters
28 ...
29 LL | trait Bar: Foo { }
30 | --- this trait cannot be made into an object...
31 = help: consider moving `foo` to another trait
32 = note: required for `&mut Thing` to implement `CoerceUnsized<&mut dyn Bar>`
33 = note: required by cast to type `&mut dyn Bar`
34
35 error: aborting due to 2 previous errors
36
37 For more information about this error, try `rustc --explain E0038`.