Skip to content

Commit 3649620

Browse files
Add tests for automatic_links lint
1 parent 2e832c9 commit 3649620

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#![deny(automatic_links)]
2+
3+
/// [http://a.com](http://a.com)
4+
//~^ ERROR Unneeded long form for URL
5+
/// [http://b.com]
6+
//~^ ERROR Unneeded long form for URL
7+
///
8+
/// [http://b.com]: http://b.com
9+
///
10+
/// [http://c.com][http://c.com]
11+
pub fn a() {}
12+
13+
/// [a](http://a.com)
14+
/// [b]
15+
///
16+
/// [b]: http://b.com
17+
pub fn everything_is_fine_here() {}
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error: Unneeded long form for URL
2+
--> $DIR/automatic-links.rs:3:5
3+
|
4+
LL | /// [http://a.com](http://a.com)
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/automatic-links.rs:1:9
9+
|
10+
LL | #![deny(automatic_links)]
11+
| ^^^^^^^^^^^^^^^
12+
= help: Try with `<http://a.com>` instead
13+
14+
error: Unneeded long form for URL
15+
--> $DIR/automatic-links.rs:5:5
16+
|
17+
LL | /// [http://b.com]
18+
| ^^^^^^^^^^^^^^
19+
|
20+
= help: Try with `<http://b.com>` instead
21+
22+
error: aborting due to 2 previous errors
23+

0 commit comments

Comments
 (0)