]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-36053.rs
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_cons...
[rust.git] / src / test / ui / issues / issue-36053.rs
1 // run-pass
2 // Regression test for #36053. ICE was caused due to obligations being
3 // added to a special, dedicated fulfillment cx during a
4 // probe. Problem seems to be related to the particular definition of
5 // `FusedIterator` in std but I was not able to isolate that into an
6 // external crate.
7
8 use std::iter::FusedIterator;
9
10 struct Thing<'a>(#[allow(unused_tuple_struct_fields)] &'a str);
11 impl<'a> Iterator for Thing<'a> {
12     type Item = &'a str;
13     fn next(&mut self) -> Option<&'a str> {
14         None
15     }
16 }
17
18 impl<'a> FusedIterator for Thing<'a> {}
19
20 fn main() {
21     Thing("test").fuse().filter(|_| true).count();
22 }