Update error messages
This commit is contained in:
parent
433f2b030b
commit
c1ea1fd2b0
@ -340,7 +340,7 @@ fn fold_item(&mut self, mut item: Item) -> Option<Item> {
|
||||
let parts = link.split('#').collect::<Vec<_>>();
|
||||
let (link, extra_fragment) = if parts.len() > 2 {
|
||||
build_diagnostic(cx, &item, &link, &dox, link_range,
|
||||
"has an anchor issue...",
|
||||
"has an issue with the link anchor.",
|
||||
"only one `#` is allowed in a link",
|
||||
None);
|
||||
continue;
|
||||
@ -625,7 +625,7 @@ fn resolution_failure(
|
||||
link_range: Option<Range<usize>>,
|
||||
) {
|
||||
build_diagnostic(cx, item, path_str, dox, link_range,
|
||||
"cannot be resolved, ignoring it...",
|
||||
"cannot be resolved, ignoring it.",
|
||||
"cannot be resolved, ignoring",
|
||||
Some("to escape `[` and `]` characters, just add '\\' before them like `\\[` or `\\]`"));
|
||||
}
|
||||
@ -639,7 +639,7 @@ fn anchor_failure(
|
||||
msg: &str,
|
||||
) {
|
||||
build_diagnostic(cx, item, path_str, dox, link_range,
|
||||
"has an anchor issue...",
|
||||
"has an issue with the link anchor.",
|
||||
msg,
|
||||
None);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: `[v2]` cannot be resolved, ignoring it...
|
||||
error: `[v2]` cannot be resolved, ignoring it.
|
||||
--> $DIR/deny-intra-link-resolution-failure.rs:3:6
|
||||
|
|
||||
LL | /// [v2]
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: `[TypeAlias::hoge]` cannot be resolved, ignoring it...
|
||||
error: `[TypeAlias::hoge]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-doc-alias-ice.rs:5:30
|
||||
|
|
||||
LL | /// [broken cross-reference](TypeAlias::hoge)
|
||||
|
@ -7,7 +7,7 @@
|
||||
/// ## For example:
|
||||
///
|
||||
/// (arr[i])
|
||||
//~^ ERROR `[i]` cannot be resolved, ignoring it...
|
||||
//~^ ERROR `[i]` cannot be resolved, ignoring it.
|
||||
pub fn test_ice() {
|
||||
unimplemented!();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: `[i]` cannot be resolved, ignoring it...
|
||||
error: `[i]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-link-span-ice-55723.rs:9:10
|
||||
|
|
||||
LL | /// (arr[i])
|
||||
|
@ -23,23 +23,23 @@ pub enum Enum {
|
||||
/// Like [Foo#hola].
|
||||
///
|
||||
/// Or maybe [Foo::f#hola].
|
||||
//~^ ERROR `[Foo::f#hola]` has an anchor issue...
|
||||
//~^ ERROR `[Foo::f#hola]` has an issue with the link anchor.
|
||||
pub fn foo() {}
|
||||
|
||||
/// Empty.
|
||||
///
|
||||
/// Another anchor error: [hello#people#!].
|
||||
//~^ ERROR `[hello#people#!]` has an anchor issue...
|
||||
//~^ ERROR `[hello#people#!]` has an issue with the link anchor.
|
||||
pub fn bar() {}
|
||||
|
||||
/// Empty?
|
||||
///
|
||||
/// Damn enum's variants: [Enum::A#whatever].
|
||||
//~^ ERROR `[Enum::A#whatever]` has an anchor issue...
|
||||
//~^ ERROR `[Enum::A#whatever]` has an issue with the link anchor.
|
||||
pub fn enum_link() {}
|
||||
|
||||
/// Primitives?
|
||||
///
|
||||
/// [u32#hello]
|
||||
//~^ ERROR `[u32#hello]` has an anchor issue...
|
||||
//~^ ERROR `[u32#hello]` has an issue with the link anchor.
|
||||
pub fn x() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: `[Foo::f#hola]` has an anchor issue...
|
||||
error: `[Foo::f#hola]` has an issue with the link anchor.
|
||||
--> $DIR/intra-links-anchors.rs:25:15
|
||||
|
|
||||
LL | /// Or maybe [Foo::f#hola].
|
||||
@ -10,19 +10,19 @@ note: lint level defined here
|
||||
LL | #![deny(intra_doc_link_resolution_failure)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `[hello#people#!]` has an anchor issue...
|
||||
error: `[hello#people#!]` has an issue with the link anchor.
|
||||
--> $DIR/intra-links-anchors.rs:31:28
|
||||
|
|
||||
LL | /// Another anchor error: [hello#people#!].
|
||||
| ^^^^^^^^^^^^^^ only one `#` is allowed in a link
|
||||
|
||||
error: `[Enum::A#whatever]` has an anchor issue...
|
||||
error: `[Enum::A#whatever]` has an issue with the link anchor.
|
||||
--> $DIR/intra-links-anchors.rs:37:28
|
||||
|
|
||||
LL | /// Damn enum's variants: [Enum::A#whatever].
|
||||
| ^^^^^^^^^^^^^^^^ variants cannot be followed by anchors
|
||||
|
||||
error: `[u32#hello]` has an anchor issue...
|
||||
error: `[u32#hello]` has an issue with the link anchor.
|
||||
--> $DIR/intra-links-anchors.rs:43:6
|
||||
|
|
||||
LL | /// [u32#hello]
|
||||
|
@ -1,4 +1,4 @@
|
||||
warning: `[error]` cannot be resolved, ignoring it...
|
||||
warning: `[error]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning-crlf.rs:7:6
|
||||
|
|
||||
LL | /// [error]
|
||||
@ -7,7 +7,7 @@ LL | /// [error]
|
||||
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error1]` cannot be resolved, ignoring it...
|
||||
warning: `[error1]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning-crlf.rs:12:11
|
||||
|
|
||||
LL | /// docs [error1]
|
||||
@ -15,7 +15,7 @@ LL | /// docs [error1]
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error2]` cannot be resolved, ignoring it...
|
||||
warning: `[error2]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning-crlf.rs:15:11
|
||||
|
|
||||
LL | /// docs [error2]
|
||||
@ -23,7 +23,7 @@ LL | /// docs [error2]
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error]` cannot be resolved, ignoring it...
|
||||
warning: `[error]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning-crlf.rs:23:20
|
||||
|
|
||||
LL | * It also has an [error].
|
||||
|
@ -1,4 +1,4 @@
|
||||
warning: `[Foo::baz]` cannot be resolved, ignoring it...
|
||||
warning: `[Foo::baz]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:3:23
|
||||
|
|
||||
LL | //! Test with [Foo::baz], [Bar::foo], ...
|
||||
@ -7,7 +7,7 @@ LL | //! Test with [Foo::baz], [Bar::foo], ...
|
||||
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[Bar::foo]` cannot be resolved, ignoring it...
|
||||
warning: `[Bar::foo]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:3:35
|
||||
|
|
||||
LL | //! Test with [Foo::baz], [Bar::foo], ...
|
||||
@ -15,7 +15,7 @@ LL | //! Test with [Foo::baz], [Bar::foo], ...
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[Uniooon::X]` cannot be resolved, ignoring it...
|
||||
warning: `[Uniooon::X]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:6:13
|
||||
|
|
||||
LL | //! , [Uniooon::X] and [Qux::Z].
|
||||
@ -23,7 +23,7 @@ LL | //! , [Uniooon::X] and [Qux::Z].
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[Qux::Z]` cannot be resolved, ignoring it...
|
||||
warning: `[Qux::Z]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:6:30
|
||||
|
|
||||
LL | //! , [Uniooon::X] and [Qux::Z].
|
||||
@ -31,7 +31,7 @@ LL | //! , [Uniooon::X] and [Qux::Z].
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[Uniooon::X]` cannot be resolved, ignoring it...
|
||||
warning: `[Uniooon::X]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:10:14
|
||||
|
|
||||
LL | //! , [Uniooon::X] and [Qux::Z].
|
||||
@ -39,7 +39,7 @@ LL | //! , [Uniooon::X] and [Qux::Z].
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[Qux::Z]` cannot be resolved, ignoring it...
|
||||
warning: `[Qux::Z]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:10:31
|
||||
|
|
||||
LL | //! , [Uniooon::X] and [Qux::Z].
|
||||
@ -47,7 +47,7 @@ LL | //! , [Uniooon::X] and [Qux::Z].
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[Qux:Y]` cannot be resolved, ignoring it...
|
||||
warning: `[Qux:Y]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:14:13
|
||||
|
|
||||
LL | /// [Qux:Y]
|
||||
@ -55,7 +55,7 @@ LL | /// [Qux:Y]
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error]` cannot be resolved, ignoring it...
|
||||
warning: `[error]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:58:30
|
||||
|
|
||||
LL | * time to introduce a link [error]*/
|
||||
@ -63,7 +63,7 @@ LL | * time to introduce a link [error]*/
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error]` cannot be resolved, ignoring it...
|
||||
warning: `[error]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:64:30
|
||||
|
|
||||
LL | * time to introduce a link [error]
|
||||
@ -71,7 +71,7 @@ LL | * time to introduce a link [error]
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error]` cannot be resolved, ignoring it...
|
||||
warning: `[error]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:68:1
|
||||
|
|
||||
LL | #[doc = "single line [error]"]
|
||||
@ -83,7 +83,7 @@ LL | #[doc = "single line [error]"]
|
||||
^^^^^
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error]` cannot be resolved, ignoring it...
|
||||
warning: `[error]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:71:1
|
||||
|
|
||||
LL | #[doc = "single line with \"escaping\" [error]"]
|
||||
@ -95,7 +95,7 @@ LL | #[doc = "single line with \"escaping\" [error]"]
|
||||
^^^^^
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error]` cannot be resolved, ignoring it...
|
||||
warning: `[error]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:74:1
|
||||
|
|
||||
LL | / /// Item docs.
|
||||
@ -109,7 +109,7 @@ LL | | /// [error]
|
||||
^^^^^
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error1]` cannot be resolved, ignoring it...
|
||||
warning: `[error1]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:80:11
|
||||
|
|
||||
LL | /// docs [error1]
|
||||
@ -117,7 +117,7 @@ LL | /// docs [error1]
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[error2]` cannot be resolved, ignoring it...
|
||||
warning: `[error2]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:82:11
|
||||
|
|
||||
LL | /// docs [error2]
|
||||
@ -125,7 +125,7 @@ LL | /// docs [error2]
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[BarA]` cannot be resolved, ignoring it...
|
||||
warning: `[BarA]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:21:10
|
||||
|
|
||||
LL | /// bar [BarA] bar
|
||||
@ -133,7 +133,7 @@ LL | /// bar [BarA] bar
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[BarB]` cannot be resolved, ignoring it...
|
||||
warning: `[BarB]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:27:9
|
||||
|
|
||||
LL | * bar [BarB] bar
|
||||
@ -141,7 +141,7 @@ LL | * bar [BarB] bar
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[BarC]` cannot be resolved, ignoring it...
|
||||
warning: `[BarC]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:34:6
|
||||
|
|
||||
LL | bar [BarC] bar
|
||||
@ -149,7 +149,7 @@ LL | bar [BarC] bar
|
||||
|
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[BarD]` cannot be resolved, ignoring it...
|
||||
warning: `[BarD]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:45:1
|
||||
|
|
||||
LL | #[doc = "Foo\nbar [BarD] bar\nbaz"]
|
||||
@ -161,7 +161,7 @@ LL | #[doc = "Foo\nbar [BarD] bar\nbaz"]
|
||||
^^^^
|
||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||
|
||||
warning: `[BarF]` cannot be resolved, ignoring it...
|
||||
warning: `[BarF]` cannot be resolved, ignoring it.
|
||||
--> $DIR/intra-links-warning.rs:50:9
|
||||
|
|
||||
LL | #[doc = $f]
|
||||
|
@ -15,7 +15,7 @@ LL | #![deny(rustdoc)]
|
||||
| ^^^^^^^
|
||||
= note: `#[deny(private_doc_tests)]` implied by `#[deny(rustdoc)]`
|
||||
|
||||
error: `[error]` cannot be resolved, ignoring it...
|
||||
error: `[error]` cannot be resolved, ignoring it.
|
||||
--> $DIR/lint-group.rs:9:29
|
||||
|
|
||||
LL | /// what up, let's make an [error]
|
||||
|
Loading…
Reference in New Issue
Block a user