Add help for intra-link lint

This commit is contained in:
Guillaume Gomez 2018-06-09 17:30:22 +02:00
parent 8c43c93e6d
commit 2e343f384f
3 changed files with 25 additions and 3 deletions

View 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 `[` and `]`");
diag.emit();
}

View 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 `[` and `]`

View 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 `[` and `]`
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 `[` and `]`
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 `[` and `]`
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 `[` and `]`
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 `[` and `]`
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 `[` and `]`
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 `[` and `]`
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 `[` and `]`
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 `[` and `]`
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 `[` and `]`
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 `[` and `]`
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 `[` and `]`