]> git.proxmox.com Git - rustc.git/blob - src/test/ui/generic-associated-types/trait-objects.stderr
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / generic-associated-types / trait-objects.stderr
1 error[E0038]: the trait `StreamingIterator` cannot be made into an object
2 --> $DIR/trait-objects.rs:10:21
3 |
4 LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object
6 |
7 = help: consider moving `Item` to another trait
8 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>
9 --> $DIR/trait-objects.rs:4:10
10 |
11 LL | trait StreamingIterator {
12 | ----------------- this trait cannot be made into an object...
13 LL | type Item<'a> where Self: 'a;
14 | ^^^^ ...because it contains the generic associated type `Item`
15
16 error: aborting due to previous error
17
18 For more information about this error, try `rustc --explain E0038`.