forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#134432 - GuillaumeGomez:intra-doc-in-footnotes, r=notriddle Fix intra doc links not generated inside footnote definitions Fixes rust-lang#132208. The problem was that we were running the `Footnote` "pass" before the `LinkReplacer` one. Sadly, the change is bigger than it should because we can't specialize the `Iterator` trait implementation, forcing me to add a new type to handle the other `Iterator` kind (the one which still has the `Range`). r? ``@notriddle``
- Loading branch information
Showing
2 changed files
with
74 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Rustdoc has multiple passes and if the footnote pass is run before the link replacer | ||
// one, intra doc links are not generated inside footnote definitions. This test | ||
// therefore ensures that intra-doc link are correctly generated inside footnote | ||
// definitions. | ||
// | ||
// Regression test for <https://github.com/rust-lang/rust/issues/132208>. | ||
|
||
#![crate_name = "foo"] | ||
|
||
//@ has 'foo/index.html' | ||
//@ has - '//*[@class="docblock"]//a[@href="struct.Bar.html"]' 'a' | ||
//@ has - '//*[@class="docblock"]//*[@class="footnotes"]//a[@href="struct.Foo.html"]' 'b' | ||
|
||
//! [a]: crate::Bar | ||
//! [b]: crate::Foo | ||
//! | ||
//! link in body: [a] | ||
//! | ||
//! see footnote[^1] | ||
//! | ||
//! [^1]: link in footnote: [b] | ||
pub struct Bar; | ||
pub struct Foo; |