From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/rustdoc/spotlight-from-dependency.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/rustdoc/spotlight-from-dependency.rs (limited to 'tests/rustdoc/spotlight-from-dependency.rs') diff --git a/tests/rustdoc/spotlight-from-dependency.rs b/tests/rustdoc/spotlight-from-dependency.rs new file mode 100644 index 000000000..090ad187d --- /dev/null +++ b/tests/rustdoc/spotlight-from-dependency.rs @@ -0,0 +1,25 @@ +#![crate_name = "foo"] + +use std::iter::Iterator; + +// @has foo/struct.Odd.html +// @has - '//*[@id="method.new"]//a[@class="notable-traits"]/@data-ty' 'Odd' +// @snapshot odd - '//script[@id="notable-traits-data"]' +pub struct Odd { + current: usize, +} + +impl Odd { + pub fn new() -> Odd { + Odd { current: 1 } + } +} + +impl Iterator for Odd { + type Item = usize; + + fn next(&mut self) -> Option { + self.current += 2; + Some(self.current - 2) + } +} -- cgit v1.2.3