about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-20 13:34:48 +0000
committerbors <bors@rust-lang.org>2022-04-20 13:34:48 +0000
commitd39864d64e6e0762d418f6beeedb4510942fc828 (patch)
tree2106cdb1ff078a58995e08633bbed36b189efd95 /src/test/rustdoc
parent0034bbca260bfa00798d70150970924221688ede (diff)
parentca5c752a7a04f9a5149df1399106f103c6e5ba17 (diff)
downloadrust-d39864d64e6e0762d418f6beeedb4510942fc828.tar.gz
rust-d39864d64e6e0762d418f6beeedb4510942fc828.zip
Auto merge of #96135 - petrochenkov:doclink6, r=GuillaumeGomez
rustdoc: Optimize and refactor doc link resolution

One more subset of https://github.com/rust-lang/rust/pull/94857 that should bring perf improvements rather than regressions + a couple more optimizations on top of it.
It's better to read individual commits and their descriptions to understand the changes.
The `may_have_doc_links` optimization is not *very* useful here, but it's much more important for https://github.com/rust-lang/rust/pull/94857.

Closes https://github.com/rust-lang/rust/issues/96079
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/early-unindent.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/rustdoc/early-unindent.rs b/src/test/rustdoc/early-unindent.rs
new file mode 100644
index 00000000000..791a452c957
--- /dev/null
+++ b/src/test/rustdoc/early-unindent.rs
@@ -0,0 +1,26 @@
+// This is a regression for https://github.com/rust-lang/rust/issues/96079.
+
+#![crate_name = "foo"]
+
+pub mod app {
+    pub struct S;
+
+    impl S {
+        // @has 'foo/app/struct.S.html'
+        // @has - '//a[@href="../enums/enum.Foo.html#method.by_name"]' 'Foo::by_name'
+        /**
+        Doc comment hello! [`Foo::by_name`](`crate::enums::Foo::by_name`).
+        */
+        pub fn whatever(&self) {}
+    }
+}
+
+pub mod enums {
+    pub enum Foo {
+        Bar,
+    }
+
+    impl Foo {
+        pub fn by_name(&self) {}
+    }
+}