From e6c7868fb289c3f34a24a9498e5d010ca0f48fa6 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 9 Jun 2018 21:07:09 +0200 Subject: [PATCH] Update help message to escape square brackets --- src/librustdoc/clean/mod.rs | 4 ++-- .../deny-intra-link-resolution-failure.stderr | 2 +- .../rustdoc-ui/intra-links-warning.stderr | 24 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 6842f1fae496f..9905c69b38da1 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1315,8 +1315,8 @@ fn resolution_failure( sp, &msg) }; - diag.help("to escape `[` and `]` characters, either put them into \"`[]`\" or \ - use HTML values `[` and `]`"); + diag.help("to escape `[` and `]` characters, just add '\\' before them like \ + `\\[` or `\\]`"); diag.emit(); } diff --git a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr index 40a7427d733b2..78526b3087a21 100644 --- a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr +++ b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr @@ -9,5 +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 `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` diff --git a/src/test/rustdoc-ui/intra-links-warning.stderr b/src/test/rustdoc-ui/intra-links-warning.stderr index d19ea93fa6344..6e47114af7050 100644 --- a/src/test/rustdoc-ui/intra-links-warning.stderr +++ b/src/test/rustdoc-ui/intra-links-warning.stderr @@ -5,7 +5,7 @@ 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 `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[Bar::foo]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:13:35 @@ -13,7 +13,7 @@ warning: `[Bar::foo]` cannot be resolved, ignoring it... 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 `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[Uniooon::X]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:14:13 @@ -21,7 +21,7 @@ warning: `[Uniooon::X]` cannot be resolved, ignoring it... 14 | //! , [Uniooon::X] and [Qux::Z]. | ^^^^^^^^^^ cannot be resolved, ignoring | - = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[Qux::Z]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:14:30 @@ -29,7 +29,7 @@ warning: `[Qux::Z]` cannot be resolved, ignoring it... 14 | //! , [Uniooon::X] and [Qux::Z]. | ^^^^^^ cannot be resolved, ignoring | - = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[Uniooon::X]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:16:14 @@ -37,7 +37,7 @@ warning: `[Uniooon::X]` cannot be resolved, ignoring it... 16 | //! , [Uniooon::X] and [Qux::Z]. | ^^^^^^^^^^ cannot be resolved, ignoring | - = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[Qux::Z]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:16:31 @@ -45,7 +45,7 @@ warning: `[Qux::Z]` cannot be resolved, ignoring it... 16 | //! , [Uniooon::X] and [Qux::Z]. | ^^^^^^ cannot be resolved, ignoring | - = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[Qux:Y]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:18:13 @@ -53,7 +53,7 @@ warning: `[Qux:Y]` cannot be resolved, ignoring it... 18 | /// [Qux:Y] | ^^^^^ cannot be resolved, ignoring | - = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[BarA]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:24:10 @@ -61,7 +61,7 @@ warning: `[BarA]` cannot be resolved, ignoring it... 24 | /// bar [BarA] bar | ^^^^ cannot be resolved, ignoring | - = help: to escape `[` and `]` characters, either put them into "`[]`" or use HTML values `[` and `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[BarB]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:28:1 @@ -77,7 +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 `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[BarC]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:35:1 @@ -95,7 +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 `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[BarD]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:48:1 @@ -107,7 +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 `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]` warning: `[BarF]` cannot be resolved, ignoring it... --> $DIR/intra-links-warning.rs:53:9 @@ -122,5 +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 `]` + = help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`