Skip to content

Commit e6c7868

Browse files
Update help message to escape square brackets
1 parent 6d5e6b4 commit e6c7868

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/librustdoc/clean/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1315,8 +1315,8 @@ fn resolution_failure(
13151315
sp,
13161316
&msg)
13171317
};
1318-
diag.help("to escape `[` and `]` characters, either put them into \"`[]`\" or \
1319-
use HTML values `[` and `]`");
1318+
diag.help("to escape `[` and `]` characters, just add '\\' before them like \
1319+
`\\[` or `\\]`");
13201320
diag.emit();
13211321
}
13221322

src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ note: lint level defined here
99
|
1010
11 | #![deny(intra_link_resolution_failure)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
12+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
1313

src/test/rustdoc-ui/intra-links-warning.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,63 @@ warning: `[Foo::baz]` cannot be resolved, ignoring it...
55
| ^^^^^^^^ cannot be resolved, ignoring
66
|
77
= note: #[warn(intra_link_resolution_failure)] on by default
8-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
8+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
99

1010
warning: `[Bar::foo]` cannot be resolved, ignoring it...
1111
--> $DIR/intra-links-warning.rs:13:35
1212
|
1313
13 | //! Test with [Foo::baz], [Bar::foo], ...
1414
| ^^^^^^^^ cannot be resolved, ignoring
1515
|
16-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
16+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
1717

1818
warning: `[Uniooon::X]` cannot be resolved, ignoring it...
1919
--> $DIR/intra-links-warning.rs:14:13
2020
|
2121
14 | //! , [Uniooon::X] and [Qux::Z].
2222
| ^^^^^^^^^^ cannot be resolved, ignoring
2323
|
24-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
24+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
2525

2626
warning: `[Qux::Z]` cannot be resolved, ignoring it...
2727
--> $DIR/intra-links-warning.rs:14:30
2828
|
2929
14 | //! , [Uniooon::X] and [Qux::Z].
3030
| ^^^^^^ cannot be resolved, ignoring
3131
|
32-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
32+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
3333

3434
warning: `[Uniooon::X]` cannot be resolved, ignoring it...
3535
--> $DIR/intra-links-warning.rs:16:14
3636
|
3737
16 | //! , [Uniooon::X] and [Qux::Z].
3838
| ^^^^^^^^^^ cannot be resolved, ignoring
3939
|
40-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
40+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
4141

4242
warning: `[Qux::Z]` cannot be resolved, ignoring it...
4343
--> $DIR/intra-links-warning.rs:16:31
4444
|
4545
16 | //! , [Uniooon::X] and [Qux::Z].
4646
| ^^^^^^ cannot be resolved, ignoring
4747
|
48-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
48+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
4949

5050
warning: `[Qux:Y]` cannot be resolved, ignoring it...
5151
--> $DIR/intra-links-warning.rs:18:13
5252
|
5353
18 | /// [Qux:Y]
5454
| ^^^^^ cannot be resolved, ignoring
5555
|
56-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
56+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
5757

5858
warning: `[BarA]` cannot be resolved, ignoring it...
5959
--> $DIR/intra-links-warning.rs:24:10
6060
|
6161
24 | /// bar [BarA] bar
6262
| ^^^^ cannot be resolved, ignoring
6363
|
64-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
64+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
6565

6666
warning: `[BarB]` cannot be resolved, ignoring it...
6767
--> $DIR/intra-links-warning.rs:28:1
@@ -77,7 +77,7 @@ warning: `[BarB]` cannot be resolved, ignoring it...
7777

7878
bar [BarB] bar
7979
^^^^
80-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
80+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
8181

8282
warning: `[BarC]` cannot be resolved, ignoring it...
8383
--> $DIR/intra-links-warning.rs:35:1
@@ -95,7 +95,7 @@ warning: `[BarC]` cannot be resolved, ignoring it...
9595

9696
bar [BarC] bar
9797
^^^^
98-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
98+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
9999

100100
warning: `[BarD]` cannot be resolved, ignoring it...
101101
--> $DIR/intra-links-warning.rs:48:1
@@ -107,7 +107,7 @@ warning: `[BarD]` cannot be resolved, ignoring it...
107107

108108
bar [BarD] bar
109109
^^^^
110-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
110+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
111111

112112
warning: `[BarF]` cannot be resolved, ignoring it...
113113
--> $DIR/intra-links-warning.rs:53:9
@@ -122,5 +122,5 @@ warning: `[BarF]` cannot be resolved, ignoring it...
122122

123123
bar [BarF] bar
124124
^^^^
125-
= help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]`
125+
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
126126

0 commit comments

Comments
 (0)