]> git.lizzy.rs Git - rust.git/blob - src/test/ui/polymorphization/symbol-ambiguity.rs
Rollup merge of #87440 - twetzel59:fix-barrier-no-op, r=yaahc
[rust.git] / src / test / ui / polymorphization / symbol-ambiguity.rs
1 // build-pass
2 // compile-flags: -Zpolymorphize=on -Zsymbol-mangling-version=v0
3
4 pub(crate) struct Foo<'a, I, E>(I, &'a E);
5
6 impl<'a, I, T: 'a, E> Iterator for Foo<'a, I, E>
7 where
8     I: Iterator<Item = &'a (T, E)>,
9 {
10     type Item = T;
11
12     fn next(&mut self) -> Option<Self::Item> {
13         self.find(|_| true)
14     }
15 }
16
17 fn main() {
18     let mut a = Foo([(1u32, 1u16)].iter(), &1u16);
19     let mut b = Foo([(1u16, 1u32)].iter(), &1u32);
20     let _ = a.next();
21     let _ = b.next();
22 }