summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc/spotlight-from-dependency.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/rustdoc/spotlight-from-dependency.rs')
-rw-r--r--src/test/rustdoc/spotlight-from-dependency.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/rustdoc/spotlight-from-dependency.rs b/src/test/rustdoc/spotlight-from-dependency.rs
new file mode 100644
index 000000000..524578921
--- /dev/null
+++ b/src/test/rustdoc/spotlight-from-dependency.rs
@@ -0,0 +1,24 @@
+#![crate_name = "foo"]
+
+use std::iter::Iterator;
+
+// @has foo/struct.Odd.html
+// @has - '//*[@id="method.new"]//span[@class="notable-traits"]//code/span' 'impl Iterator for Odd'
+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::Item> {
+ self.current += 2;
+ Some(self.current - 2)
+ }
+}