Rollup merge of #112498 - SamZhang3:rust-reference-link-update, r=Nilstrieb
Update links to Rust Reference in diagnostic Instead of linking to the [old Rust Reference site](https://static.rust-lang.org/doc/master/reference.html#literals), which is severely outdated (Rust 1.17), link to the [current website](https://doc.rust-lang.org/stable/reference/expressions/literal-expr.html) in diagnostic about incorrect literals.
This commit is contained in:
commit
46b64aaef0
6 changed files with 9 additions and 9 deletions
|
@ -158,7 +158,7 @@ pub(crate) fn emit_unescape_error(
|
||||||
|
|
||||||
diag.help(
|
diag.help(
|
||||||
"for more information, visit \
|
"for more information, visit \
|
||||||
<https://static.rust-lang.org/doc/master/reference.html#literals>",
|
<https://doc.rust-lang.org/reference/tokens.html#literals>",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
diag.emit();
|
diag.emit();
|
||||||
|
|
|
@ -16,7 +16,7 @@ error: unknown character escape: `\u{25cf}`
|
||||||
LL | '\●'
|
LL | '\●'
|
||||||
| ^ unknown character escape
|
| ^ unknown character escape
|
||||||
|
|
|
|
||||||
= help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
|
= help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
|
||||||
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
||||||
|
|
|
|
||||||
LL | r"\●"
|
LL | r"\●"
|
||||||
|
@ -28,7 +28,7 @@ error: unknown character escape: `\u{25cf}`
|
||||||
LL | "\●"
|
LL | "\●"
|
||||||
| ^ unknown character escape
|
| ^ unknown character escape
|
||||||
|
|
|
|
||||||
= help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
|
= help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
|
||||||
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
||||||
|
|
|
|
||||||
LL | r"\●"
|
LL | r"\●"
|
||||||
|
|
|
@ -2,6 +2,6 @@ fn main() {
|
||||||
let ok = r"ab\[c";
|
let ok = r"ab\[c";
|
||||||
let bad = "ab\[c";
|
let bad = "ab\[c";
|
||||||
//~^ ERROR unknown character escape: `[`
|
//~^ ERROR unknown character escape: `[`
|
||||||
//~| HELP for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
|
//~| HELP for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
|
||||||
//~| HELP if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
//~| HELP if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: unknown character escape: `[`
|
||||||
LL | let bad = "ab\[c";
|
LL | let bad = "ab\[c";
|
||||||
| ^ unknown character escape
|
| ^ unknown character escape
|
||||||
|
|
|
|
||||||
= help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
|
= help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
|
||||||
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
||||||
|
|
|
|
||||||
LL | let bad = r"ab\[c";
|
LL | let bad = r"ab\[c";
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: unknown byte escape: `f`
|
||||||
LL | static FOO: u8 = b'\f';
|
LL | static FOO: u8 = b'\f';
|
||||||
| ^ unknown byte escape
|
| ^ unknown byte escape
|
||||||
|
|
|
|
||||||
= help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
|
= help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
|
||||||
|
|
||||||
error: unknown byte escape: `f`
|
error: unknown byte escape: `f`
|
||||||
--> $DIR/byte-literals.rs:6:8
|
--> $DIR/byte-literals.rs:6:8
|
||||||
|
@ -12,7 +12,7 @@ error: unknown byte escape: `f`
|
||||||
LL | b'\f';
|
LL | b'\f';
|
||||||
| ^ unknown byte escape
|
| ^ unknown byte escape
|
||||||
|
|
|
|
||||||
= help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
|
= help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
|
||||||
|
|
||||||
error: invalid character in numeric character escape: `Z`
|
error: invalid character in numeric character escape: `Z`
|
||||||
--> $DIR/byte-literals.rs:7:10
|
--> $DIR/byte-literals.rs:7:10
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: unknown byte escape: `f`
|
||||||
LL | static FOO: &'static [u8] = b"\f";
|
LL | static FOO: &'static [u8] = b"\f";
|
||||||
| ^ unknown byte escape
|
| ^ unknown byte escape
|
||||||
|
|
|
|
||||||
= help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
|
= help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
|
||||||
|
|
||||||
error: unknown byte escape: `f`
|
error: unknown byte escape: `f`
|
||||||
--> $DIR/byte-string-literals.rs:4:8
|
--> $DIR/byte-string-literals.rs:4:8
|
||||||
|
@ -12,7 +12,7 @@ error: unknown byte escape: `f`
|
||||||
LL | b"\f";
|
LL | b"\f";
|
||||||
| ^ unknown byte escape
|
| ^ unknown byte escape
|
||||||
|
|
|
|
||||||
= help: for more information, visit <https://static.rust-lang.org/doc/master/reference.html#literals>
|
= help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
|
||||||
|
|
||||||
error: invalid character in numeric character escape: `Z`
|
error: invalid character in numeric character escape: `Z`
|
||||||
--> $DIR/byte-string-literals.rs:5:10
|
--> $DIR/byte-string-literals.rs:5:10
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue