Skip to content

Commit fce2be0

Browse files
Update URLs used in the lint example
1 parent 60caf51 commit fce2be0

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/doc/rustdoc/src/lints.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,33 +292,34 @@ This lint is **nightly-only** and **warns by default**. It detects links which
292292
could use the "automatic" link syntax. For example:
293293

294294
```rust
295-
/// http://hello.rs
296-
/// [http://a.com](http://a.com)
297-
/// [http://b.com]
295+
/// http://example.org
296+
/// [http://example.com](http://example.com)
297+
/// [http://example.net]
298298
///
299-
/// [http://b.com]: http://b.com
299+
/// [http://example.com]: http://example.com
300300
pub fn foo() {}
301301
```
302302

303303
Which will give:
304304

305305
```text
306306
warning: this URL is not a hyperlink
307-
--> foo.rs:3:5
307+
--> foo.rs:1:5
308308
|
309-
3 | /// http://hello.rs
310-
| ^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://hello.rs>`
309+
1 | /// http://example.org
310+
| ^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://example.org>`
311311
|
312+
= note: `#[warn(url_improvements)]` on by default
312313
313314
warning: unneeded long form for URL
314-
--> foo.rs:4:5
315+
--> foo.rs:2:5
315316
|
316-
4 | /// [http://a.com](http://a.com)
317-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://a.com>`
317+
2 | /// [http://example.com](http://example.com)
318+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://example.com>`
318319
319-
warning: unneeded long form for URL
320-
--> foo.rs:5:5
320+
warning: this URL is not a hyperlink
321+
--> foo.rs:3:6
321322
|
322-
5 | /// [http://b.com]
323-
| ^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://b.com>`
323+
3 | /// [http://example.net]
324+
| ^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://example.net>`
324325
```

0 commit comments

Comments
 (0)