]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/trait-objects.rs
Merge commit '5ff7b632a95bac6955611d85040859128902c580' into sync-rustfmt-subtree
[rust.git] / src / test / ui / generic-associated-types / trait-objects.rs
1 #![feature(generic_associated_types)]
2
3 trait StreamingIterator {
4     type Item<'a> where Self: 'a;
5     fn size_hint(&self) -> (usize, Option<usize>);
6     // Uncommenting makes `StreamingIterator` not object safe
7 //    fn next(&mut self) -> Self::Item<'_>;
8 }
9
10 fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
11     //~^ the trait `StreamingIterator` cannot be made into an object
12     x.size_hint().0
13 }
14
15 fn main() {}