Skip to content

Commit f330a98

Browse files
committed
go back to ignoring "intra-doc links" with spaces in them
1 parent ddd7540 commit f330a98

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ fn preprocess_link(
10031003
assert!(!path_str.contains(['<', '>'].as_slice()));
10041004

10051005
// The link is not an intra-doc link if it still contains spaces after stripping generics.
1006-
if can_be_url && path_str.contains(' ') {
1006+
if path_str.contains(' ') {
10071007
return None;
10081008
}
10091009

tests/rustdoc-ui/bad-intra-doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/// this is not a link to [`example.com`] //~ERROR unresolved link
77
///
8-
/// this link [`has spaces in it`]. //~ERROR unresolved link
8+
/// this link [`has spaces in it`].
99
///
1010
/// attempted link to method: [`Foo.bar()`] //~ERROR unresolved link
1111
///

tests/rustdoc-ui/bad-intra-doc.stderr

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ note: the lint level is defined here
1111
LL | #![deny(rustdoc::broken_intra_doc_links)]
1212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1313

14-
error: unresolved link to `has spaces in it`
15-
--> $DIR/bad-intra-doc.rs:8:17
16-
|
17-
LL | /// this link [`has spaces in it`].
18-
| ^^^^^^^^^^^^^^^^ no item named `has spaces in it` in scope
19-
|
20-
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
21-
2214
error: unresolved link to `Foo.bar`
2315
--> $DIR/bad-intra-doc.rs:10:33
2416
|
@@ -35,5 +27,5 @@ LL | /// classic broken intra-doc link: [`Bar`]
3527
|
3628
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
3729

38-
error: aborting due to 4 previous errors
30+
error: aborting due to 3 previous errors
3931

0 commit comments

Comments
 (0)