File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ // Checks that links to crates are correctly generated and only existing crates
2+ // have a link generated.
3+ // Regression test for <https://github.com/rust-lang/rust/issues/137857>.
4+
5+ //@ compile-flags: --document-private-items -Z unstable-options
6+ //@ compile-flags: --extern-html-root-url=empty=https://empty.example/
7+ // This one is to ensure that we don't link to any item we see which has
8+ // an external html root URL unless it actually exists.
9+ //@ compile-flags: --extern-html-root-url=non_existant=https://non-existant.example/
10+ //@ aux-build: empty.rs
11+
12+ #![ crate_name = "foo" ]
13+ #![ expect( rustdoc:: broken_intra_doc_links) ]
14+
15+ //@ has 'foo/index.html'
16+ //@ has - '//a[@href="https://empty.example/empty/index.html"]' 'empty'
17+ // There should only be one intra doc links, we should not link `non_existant`.
18+ //@ count - '//*[@class="docblock"]//a' 1
19+ //! [`empty`]
20+ //!
21+ //! [`non_existant`]
22+
23+ extern crate empty;
You can’t perform that action at this time.
0 commit comments