summary refs log tree commit diff
path: root/src/doc/rustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-10-13 15:46:34 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-11-05 10:22:08 +0100
commitf467b8d77c7b991ce214e0e5ff9b13c01812c8a7 (patch)
tree4a4d135e0c4348e14053d3b02a4b063823c6d8f2 /src/doc/rustdoc
parent6bc8965c418e90c135ee90554108bd0bdbe0a8d8 (diff)
downloadrust-f467b8d77c7b991ce214e0e5ff9b13c01812c8a7.tar.gz
rust-f467b8d77c7b991ce214e0e5ff9b13c01812c8a7.zip
Extend automatic_links lint to take into account URLs without link syntax
Diffstat (limited to 'src/doc/rustdoc')
-rw-r--r--src/doc/rustdoc/src/lints.md22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md
index 2c10f6c06a9..a85aa882af8 100644
--- a/src/doc/rustdoc/src/lints.md
+++ b/src/doc/rustdoc/src/lints.md
@@ -294,6 +294,7 @@ which could use the "automatic" link syntax. For example:
 ```rust
 #![warn(automatic_links)]
 
+/// http://hello.rs
 /// [http://a.com](http://a.com)
 /// [http://b.com]
 ///
@@ -304,24 +305,27 @@ pub fn foo() {}
 Which will give:
 
 ```text
-error: Unneeded long form for URL
+warning: won't be a link as is
  --> foo.rs:3:5
   |
-3 | /// [http://a.com](http://a.com)
-  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+3 | /// http://hello.rs
+  |     ^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://hello.rs>`
   |
 note: the lint level is defined here
  --> foo.rs:1:9
   |
-1 | #![deny(automatic_links)]
+1 | #![warn(automatic_links)]
   |         ^^^^^^^^^^^^^^^
-  = help: Try with `<http://a.com>` instead
 
-error: Unneeded long form for URL
+warning: unneeded long form for URL
+ --> foo.rs:4:5
+  |
+4 | /// [http://a.com](http://a.com)
+  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://a.com>`
+
+warning: unneeded long form for URL
  --> foo.rs:5:5
   |
 5 | /// [http://b.com]
-  |     ^^^^^^^^^^^^^^
-  |
-  = help: Try with `<http://b.com>` instead
+  |     ^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://b.com>`
 ```