]> git.lizzy.rs Git - rust.git/commitdiff
Add help for intra-link lint
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 9 Jun 2018 15:30:22 +0000 (17:30 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 13 Jun 2018 19:18:55 +0000 (21:18 +0200)
src/librustdoc/clean/mod.rs
src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr
src/test/rustdoc-ui/intra-links-warning.stderr

index 8328a8385c3147dbd314b5170b5131dfeb29f371..6842f1fae496fc896ad29d6ec365ff18ac602b5e 100644 (file)
@@ -1311,10 +1311,12 @@ fn resolution_failure(
         diag
     } else {
         cx.tcx.struct_span_lint_node(lint::builtin::INTRA_LINK_RESOLUTION_FAILURE,
-                                                NodeId::new(0),
-                                                sp,
-                                                &msg)
+                                     NodeId::new(0),
+                                     sp,
+                                     &msg)
     };
+    diag.help("to escape `[` and `]` characters, either put them into \"`[]`\" or \
+               use HTML values `&#91;` and `&#93;`");
     diag.emit();
 }
 
index 3aa45405fd400246b023286c1bf7296b1178732f..40a7427d733b2311e3819e8969aea51e629d2018 100644 (file)
@@ -9,4 +9,5 @@ note: lint level defined here
    |
 11 | #![deny(intra_link_resolution_failure)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
index 4949c450343ce59de80ecf287088ff89c3b3a5ff..d19ea93fa6344cfe4e88a50e4b071c34e31c9ff2 100644 (file)
@@ -5,48 +5,63 @@ warning: `[Foo::baz]` cannot be resolved, ignoring it...
    |                       ^^^^^^^^ cannot be resolved, ignoring
    |
    = note: #[warn(intra_link_resolution_failure)] on by default
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[Bar::foo]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:13:35
    |
 13 |        //! Test with [Foo::baz], [Bar::foo], ...
    |                                   ^^^^^^^^ cannot be resolved, ignoring
+   |
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[Uniooon::X]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:14:13
    |
 14 |      //! , [Uniooon::X] and [Qux::Z].
    |             ^^^^^^^^^^ cannot be resolved, ignoring
+   |
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[Qux::Z]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:14:30
    |
 14 |      //! , [Uniooon::X] and [Qux::Z].
    |                              ^^^^^^ cannot be resolved, ignoring
+   |
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[Uniooon::X]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:16:14
    |
 16 |       //! , [Uniooon::X] and [Qux::Z].
    |              ^^^^^^^^^^ cannot be resolved, ignoring
+   |
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[Qux::Z]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:16:31
    |
 16 |       //! , [Uniooon::X] and [Qux::Z].
    |                               ^^^^^^ cannot be resolved, ignoring
+   |
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[Qux:Y]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:18:13
    |
 18 |        /// [Qux:Y]
    |             ^^^^^ cannot be resolved, ignoring
+   |
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[BarA]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:24:10
    |
 24 | /// bar [BarA] bar
    |          ^^^^ cannot be resolved, ignoring
+   |
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[BarB]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:28:1
@@ -62,6 +77,7 @@ warning: `[BarB]` cannot be resolved, ignoring it...
            
             bar [BarB] bar
                  ^^^^
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[BarC]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:35:1
@@ -79,6 +95,7 @@ warning: `[BarC]` cannot be resolved, ignoring it...
            
            bar [BarC] bar
                 ^^^^
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[BarD]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:48:1
@@ -90,6 +107,7 @@ warning: `[BarD]` cannot be resolved, ignoring it...
            
            bar [BarD] bar
                 ^^^^
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`
 
 warning: `[BarF]` cannot be resolved, ignoring it...
   --> $DIR/intra-links-warning.rs:53:9
@@ -104,4 +122,5 @@ warning: `[BarF]` cannot be resolved, ignoring it...
            
            bar [BarF] bar
                 ^^^^
+   = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `&#91;` and `&#93;`