Skip to content

Commit a918960

Browse files
committed
adjust more unit tests to reflect more aggressive intra-doc linting
1 parent 1c55445 commit a918960

6 files changed

+215
-22
lines changed

tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,67 @@
22
//@ normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
33

44
//! [struct@m!()] //~ WARN: unmatched disambiguator `struct` and suffix `!()`
5-
//! [struct@m!{}]
5+
//! [struct@m!{}] //~ WARN: unmatched disambiguator `struct` and suffix `!{}`
66
//! [struct@m![]]
77
//! [struct@f()] //~ WARN: unmatched disambiguator `struct` and suffix `()`
88
//! [struct@m!] //~ WARN: unmatched disambiguator `struct` and suffix `!`
99
//!
1010
//! [enum@m!()] //~ WARN: unmatched disambiguator `enum` and suffix `!()`
11-
//! [enum@m!{}]
11+
//! [enum@m!{}] //~ WARN: unmatched disambiguator `enum` and suffix `!{}`
1212
//! [enum@m![]]
1313
//! [enum@f()] //~ WARN: unmatched disambiguator `enum` and suffix `()`
1414
//! [enum@m!] //~ WARN: unmatched disambiguator `enum` and suffix `!`
1515
//!
1616
//! [trait@m!()] //~ WARN: unmatched disambiguator `trait` and suffix `!()`
17-
//! [trait@m!{}]
17+
//! [trait@m!{}] //~ WARN: unmatched disambiguator `trait` and suffix `!{}`
1818
//! [trait@m![]]
1919
//! [trait@f()] //~ WARN: unmatched disambiguator `trait` and suffix `()`
2020
//! [trait@m!] //~ WARN: unmatched disambiguator `trait` and suffix `!`
2121
//!
2222
//! [module@m!()] //~ WARN: unmatched disambiguator `module` and suffix `!()`
23-
//! [module@m!{}]
23+
//! [module@m!{}] //~ WARN: unmatched disambiguator `module` and suffix `!{}`
2424
//! [module@m![]]
2525
//! [module@f()] //~ WARN: unmatched disambiguator `module` and suffix `()`
2626
//! [module@m!] //~ WARN: unmatched disambiguator `module` and suffix `!`
2727
//!
2828
//! [mod@m!()] //~ WARN: unmatched disambiguator `mod` and suffix `!()`
29-
//! [mod@m!{}]
29+
//! [mod@m!{}] //~ WARN: unmatched disambiguator `mod` and suffix `!{}`
3030
//! [mod@m![]]
3131
//! [mod@f()] //~ WARN: unmatched disambiguator `mod` and suffix `()`
3232
//! [mod@m!] //~ WARN: unmatched disambiguator `mod` and suffix `!`
3333
//!
3434
//! [const@m!()] //~ WARN: unmatched disambiguator `const` and suffix `!()`
35-
//! [const@m!{}]
35+
//! [const@m!{}] //~ WARN: unmatched disambiguator `const` and suffix `!{}`
3636
//! [const@m![]]
3737
//! [const@f()] //~ WARN: incompatible link kind for `f`
3838
//! [const@m!] //~ WARN: unmatched disambiguator `const` and suffix `!`
3939
//!
4040
//! [constant@m!()] //~ WARN: unmatched disambiguator `constant` and suffix `!()`
41-
//! [constant@m!{}]
41+
//! [constant@m!{}] //~ WARN: unmatched disambiguator `constant` and suffix `!{}`
4242
//! [constant@m![]]
4343
//! [constant@f()] //~ WARN: incompatible link kind for `f`
4444
//! [constant@m!] //~ WARN: unmatched disambiguator `constant` and suffix `!`
4545
//!
4646
//! [static@m!()] //~ WARN: unmatched disambiguator `static` and suffix `!()`
47-
//! [static@m!{}]
47+
//! [static@m!{}] //~ WARN: unmatched disambiguator `static` and suffix `!{}`
4848
//! [static@m![]]
4949
//! [static@f()] //~ WARN: incompatible link kind for `f`
5050
//! [static@m!] //~ WARN: unmatched disambiguator `static` and suffix `!`
5151
//!
5252
//! [function@m!()] //~ WARN: unmatched disambiguator `function` and suffix `!()`
53-
//! [function@m!{}]
53+
//! [function@m!{}] //~ WARN: unmatched disambiguator `function` and suffix `!{}`
5454
//! [function@m![]]
5555
//! [function@f()]
5656
//! [function@m!] //~ WARN: unmatched disambiguator `function` and suffix `!`
5757
//!
5858
//! [fn@m!()] //~ WARN: unmatched disambiguator `fn` and suffix `!()`
59-
//! [fn@m!{}]
59+
//! [fn@m!{}] //~ WARN: unmatched disambiguator `fn` and suffix `!{}`
6060
//! [fn@m![]]
6161
//! [fn@f()]
6262
//! [fn@m!] //~ WARN: unmatched disambiguator `fn` and suffix `!`
6363
//!
6464
//! [method@m!()] //~ WARN: unmatched disambiguator `method` and suffix `!()`
65-
//! [method@m!{}]
65+
//! [method@m!{}] //~ WARN: unmatched disambiguator `method` and suffix `!{}`
6666
//! [method@m![]]
6767
//! [method@f()]
6868
//! [method@m!] //~ WARN: unmatched disambiguator `method` and suffix `!`
@@ -74,13 +74,13 @@
7474
//! [derive@m!] //~ WARN: incompatible link kind for `m`
7575
//!
7676
//! [type@m!()] //~ WARN: unmatched disambiguator `type` and suffix `!()`
77-
//! [type@m!{}]
77+
//! [type@m!{}] //~ WARN: unmatched disambiguator `type` and suffix `!{}`
7878
//! [type@m![]]
7979
//! [type@f()] //~ WARN: unmatched disambiguator `type` and suffix `()`
8080
//! [type@m!] //~ WARN: unmatched disambiguator `type` and suffix `!`
8181
//!
8282
//! [value@m!()] //~ WARN: unmatched disambiguator `value` and suffix `!()`
83-
//! [value@m!{}]
83+
//! [value@m!{}] //~ WARN: unmatched disambiguator `value` and suffix `!{}`
8484
//! [value@m![]]
8585
//! [value@f()]
8686
//! [value@m!] //~ WARN: unmatched disambiguator `value` and suffix `!`
@@ -92,13 +92,13 @@
9292
//! [macro@m!]
9393
//!
9494
//! [prim@m!()] //~ WARN: unmatched disambiguator `prim` and suffix `!()`
95-
//! [prim@m!{}]
95+
//! [prim@m!{}] //~ WARN: unmatched disambiguator `prim` and suffix `!{}`
9696
//! [prim@m![]]
9797
//! [prim@f()] //~ WARN: unmatched disambiguator `prim` and suffix `()`
9898
//! [prim@m!] //~ WARN: unmatched disambiguator `prim` and suffix `!`
9999
//!
100100
//! [primitive@m!()] //~ WARN: unmatched disambiguator `primitive` and suffix `!()`
101-
//! [primitive@m!{}]
101+
//! [primitive@m!{}] //~ WARN: unmatched disambiguator `primitive` and suffix `!{}`
102102
//! [primitive@m![]]
103103
//! [primitive@f()] //~ WARN: unmatched disambiguator `primitive` and suffix `()`
104104
//! [primitive@m!] //~ WARN: unmatched disambiguator `primitive` and suffix `!`

tests/rustdoc-ui/disambiguator-endswith-named-suffix.stderr

+121-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ LL | //! [struct@m!()]
77
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
88
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
99

10+
warning: unmatched disambiguator `struct` and suffix `!{}`
11+
--> $DIR/disambiguator-endswith-named-suffix.rs:5:6
12+
|
13+
LL | //! [struct@m!{}]
14+
| ^^^^^^
15+
|
16+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
17+
1018
warning: unmatched disambiguator `struct` and suffix `()`
1119
--> $DIR/disambiguator-endswith-named-suffix.rs:7:6
1220
|
@@ -31,6 +39,14 @@ LL | //! [enum@m!()]
3139
|
3240
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
3341

42+
warning: unmatched disambiguator `enum` and suffix `!{}`
43+
--> $DIR/disambiguator-endswith-named-suffix.rs:11:6
44+
|
45+
LL | //! [enum@m!{}]
46+
| ^^^^
47+
|
48+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
49+
3450
warning: unmatched disambiguator `enum` and suffix `()`
3551
--> $DIR/disambiguator-endswith-named-suffix.rs:13:6
3652
|
@@ -55,6 +71,14 @@ LL | //! [trait@m!()]
5571
|
5672
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
5773

74+
warning: unmatched disambiguator `trait` and suffix `!{}`
75+
--> $DIR/disambiguator-endswith-named-suffix.rs:17:6
76+
|
77+
LL | //! [trait@m!{}]
78+
| ^^^^^
79+
|
80+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
81+
5882
warning: unmatched disambiguator `trait` and suffix `()`
5983
--> $DIR/disambiguator-endswith-named-suffix.rs:19:6
6084
|
@@ -79,6 +103,14 @@ LL | //! [module@m!()]
79103
|
80104
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
81105

106+
warning: unmatched disambiguator `module` and suffix `!{}`
107+
--> $DIR/disambiguator-endswith-named-suffix.rs:23:6
108+
|
109+
LL | //! [module@m!{}]
110+
| ^^^^^^
111+
|
112+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
113+
82114
warning: unmatched disambiguator `module` and suffix `()`
83115
--> $DIR/disambiguator-endswith-named-suffix.rs:25:6
84116
|
@@ -103,6 +135,14 @@ LL | //! [mod@m!()]
103135
|
104136
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
105137

138+
warning: unmatched disambiguator `mod` and suffix `!{}`
139+
--> $DIR/disambiguator-endswith-named-suffix.rs:29:6
140+
|
141+
LL | //! [mod@m!{}]
142+
| ^^^
143+
|
144+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
145+
106146
warning: unmatched disambiguator `mod` and suffix `()`
107147
--> $DIR/disambiguator-endswith-named-suffix.rs:31:6
108148
|
@@ -127,6 +167,14 @@ LL | //! [const@m!()]
127167
|
128168
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
129169

170+
warning: unmatched disambiguator `const` and suffix `!{}`
171+
--> $DIR/disambiguator-endswith-named-suffix.rs:35:6
172+
|
173+
LL | //! [const@m!{}]
174+
| ^^^^^
175+
|
176+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
177+
130178
warning: incompatible link kind for `f`
131179
--> $DIR/disambiguator-endswith-named-suffix.rs:37:6
132180
|
@@ -155,6 +203,14 @@ LL | //! [constant@m!()]
155203
|
156204
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
157205

206+
warning: unmatched disambiguator `constant` and suffix `!{}`
207+
--> $DIR/disambiguator-endswith-named-suffix.rs:41:6
208+
|
209+
LL | //! [constant@m!{}]
210+
| ^^^^^^^^
211+
|
212+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
213+
158214
warning: incompatible link kind for `f`
159215
--> $DIR/disambiguator-endswith-named-suffix.rs:43:6
160216
|
@@ -183,6 +239,14 @@ LL | //! [static@m!()]
183239
|
184240
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
185241

242+
warning: unmatched disambiguator `static` and suffix `!{}`
243+
--> $DIR/disambiguator-endswith-named-suffix.rs:47:6
244+
|
245+
LL | //! [static@m!{}]
246+
| ^^^^^^
247+
|
248+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
249+
186250
warning: incompatible link kind for `f`
187251
--> $DIR/disambiguator-endswith-named-suffix.rs:49:6
188252
|
@@ -211,6 +275,14 @@ LL | //! [function@m!()]
211275
|
212276
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
213277

278+
warning: unmatched disambiguator `function` and suffix `!{}`
279+
--> $DIR/disambiguator-endswith-named-suffix.rs:53:6
280+
|
281+
LL | //! [function@m!{}]
282+
| ^^^^^^^^
283+
|
284+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
285+
214286
warning: unmatched disambiguator `function` and suffix `!`
215287
--> $DIR/disambiguator-endswith-named-suffix.rs:56:6
216288
|
@@ -227,6 +299,14 @@ LL | //! [fn@m!()]
227299
|
228300
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
229301

302+
warning: unmatched disambiguator `fn` and suffix `!{}`
303+
--> $DIR/disambiguator-endswith-named-suffix.rs:59:6
304+
|
305+
LL | //! [fn@m!{}]
306+
| ^^
307+
|
308+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
309+
230310
warning: unmatched disambiguator `fn` and suffix `!`
231311
--> $DIR/disambiguator-endswith-named-suffix.rs:62:6
232312
|
@@ -243,6 +323,14 @@ LL | //! [method@m!()]
243323
|
244324
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
245325

326+
warning: unmatched disambiguator `method` and suffix `!{}`
327+
--> $DIR/disambiguator-endswith-named-suffix.rs:65:6
328+
|
329+
LL | //! [method@m!{}]
330+
| ^^^^^^
331+
|
332+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
333+
246334
warning: unmatched disambiguator `method` and suffix `!`
247335
--> $DIR/disambiguator-endswith-named-suffix.rs:68:6
248336
|
@@ -303,6 +391,14 @@ LL | //! [type@m!()]
303391
|
304392
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
305393

394+
warning: unmatched disambiguator `type` and suffix `!{}`
395+
--> $DIR/disambiguator-endswith-named-suffix.rs:77:6
396+
|
397+
LL | //! [type@m!{}]
398+
| ^^^^
399+
|
400+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
401+
306402
warning: unmatched disambiguator `type` and suffix `()`
307403
--> $DIR/disambiguator-endswith-named-suffix.rs:79:6
308404
|
@@ -327,6 +423,14 @@ LL | //! [value@m!()]
327423
|
328424
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
329425

426+
warning: unmatched disambiguator `value` and suffix `!{}`
427+
--> $DIR/disambiguator-endswith-named-suffix.rs:83:6
428+
|
429+
LL | //! [value@m!{}]
430+
| ^^^^^
431+
|
432+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
433+
330434
warning: unmatched disambiguator `value` and suffix `!`
331435
--> $DIR/disambiguator-endswith-named-suffix.rs:86:6
332436
|
@@ -351,6 +455,14 @@ LL | //! [prim@m!()]
351455
|
352456
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
353457

458+
warning: unmatched disambiguator `prim` and suffix `!{}`
459+
--> $DIR/disambiguator-endswith-named-suffix.rs:95:6
460+
|
461+
LL | //! [prim@m!{}]
462+
| ^^^^
463+
|
464+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
465+
354466
warning: unmatched disambiguator `prim` and suffix `()`
355467
--> $DIR/disambiguator-endswith-named-suffix.rs:97:6
356468
|
@@ -375,6 +487,14 @@ LL | //! [primitive@m!()]
375487
|
376488
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
377489

490+
warning: unmatched disambiguator `primitive` and suffix `!{}`
491+
--> $DIR/disambiguator-endswith-named-suffix.rs:101:6
492+
|
493+
LL | //! [primitive@m!{}]
494+
| ^^^^^^^^^
495+
|
496+
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
497+
378498
warning: unmatched disambiguator `primitive` and suffix `()`
379499
--> $DIR/disambiguator-endswith-named-suffix.rs:103:6
380500
|
@@ -391,5 +511,5 @@ LL | //! [primitive@m!]
391511
|
392512
= note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
393513

394-
warning: 46 warnings emitted
514+
warning: 61 warnings emitted
395515

tests/rustdoc-ui/intra-doc/weird-syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub struct XLinkToCloneWithStartSpace;
6565
/// [x][struct@Clone ] //~ERROR link
6666
pub struct XLinkToCloneWithEndSpace;
6767

68-
/// [x][Clone\(\)] not URL-shaped enough
68+
/// [x][Clone\(\)] //~ERROR link
6969
pub struct XLinkToCloneWithEscapedParens;
7070

7171
/// [x][`Clone`] not URL-shaped enough

tests/rustdoc-ui/intra-doc/weird-syntax.stderr

+9-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ help: to link to the trait, prefix with `trait@`
118118
LL | /// [x][trait@Clone ]
119119
| ~~~~~~
120120

121+
error: unresolved link to `Clone\(\)`
122+
--> $DIR/weird-syntax.rs:68:9
123+
|
124+
LL | /// [x][Clone\(\)]
125+
| ^^^^^^^^^ no item named `Clone\(\)` in scope
126+
|
127+
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
128+
121129
error: unresolved link to `Clone`
122130
--> $DIR/weird-syntax.rs:74:9
123131
|
@@ -268,5 +276,5 @@ LL | /// The [cln][] link here will produce a plain text suggestion
268276
|
269277
= help: to link to the trait, prefix with `trait@`: trait@Clone
270278

271-
error: aborting due to 26 previous errors
279+
error: aborting due to 27 previous errors
272280

0 commit comments

Comments
 (0)