]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/spotlight-from-dependency.rs
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / rustdoc / spotlight-from-dependency.rs
1 #![crate_name = "foo"]
2
3 use std::iter::Iterator;
4
5 // @has foo/struct.Odd.html
6 // @has - '//*[@id="method.new"]//a[@class="notable-traits"]/@data-ty' 'Odd'
7 // @snapshot odd - '//script[@id="notable-traits-data"]'
8 pub struct Odd {
9     current: usize,
10 }
11
12 impl Odd {
13     pub fn new() -> Odd {
14         Odd { current: 1 }
15     }
16 }
17
18 impl Iterator for Odd {
19     type Item = usize;
20
21     fn next(&mut self) -> Option<Self::Item> {
22         self.current += 2;
23         Some(self.current - 2)
24     }
25 }