review comment: str
-> string in messages
This commit is contained in:
parent
4a10b01f95
commit
999a0dc300
18 changed files with 29 additions and 29 deletions
|
@ -169,7 +169,7 @@ infer_lifetime_param_suggestion_elided = each elided lifetime in input position
|
||||||
|
|
||||||
infer_meant_byte_literal = if you meant to write a byte literal, prefix with `b`
|
infer_meant_byte_literal = if you meant to write a byte literal, prefix with `b`
|
||||||
infer_meant_char_literal = if you meant to write a `char` literal, use single quotes
|
infer_meant_char_literal = if you meant to write a `char` literal, use single quotes
|
||||||
infer_meant_str_literal = if you meant to write a `str` literal, use double quotes
|
infer_meant_str_literal = if you meant to write a string literal, use double quotes
|
||||||
infer_mismatched_static_lifetime = incompatible lifetime on type
|
infer_mismatched_static_lifetime = incompatible lifetime on type
|
||||||
infer_more_targeted = {$has_param_name ->
|
infer_more_targeted = {$has_param_name ->
|
||||||
[true] `{$param_name}`
|
[true] `{$param_name}`
|
||||||
|
|
|
@ -570,7 +570,7 @@ parse_more_than_one_char = character literal may only contain one codepoint
|
||||||
.remove_non = consider removing the non-printing characters
|
.remove_non = consider removing the non-printing characters
|
||||||
.use_double_quotes = if you meant to write a {$is_byte ->
|
.use_double_quotes = if you meant to write a {$is_byte ->
|
||||||
[true] byte string
|
[true] byte string
|
||||||
*[false] `str`
|
*[false] string
|
||||||
} literal, use double quotes
|
} literal, use double quotes
|
||||||
|
|
||||||
parse_multiple_skipped_lines = multiple lines skipped by escaped newline
|
parse_multiple_skipped_lines = multiple lines skipped by escaped newline
|
||||||
|
@ -835,7 +835,7 @@ parse_unknown_prefix = prefix `{$prefix}` is unknown
|
||||||
.label = unknown prefix
|
.label = unknown prefix
|
||||||
.note = prefixed identifiers and literals are reserved since Rust 2021
|
.note = prefixed identifiers and literals are reserved since Rust 2021
|
||||||
.suggestion_br = use `br` for a raw byte string
|
.suggestion_br = use `br` for a raw byte string
|
||||||
.suggestion_str = if you meant to write a `str` literal, use double quotes
|
.suggestion_str = if you meant to write a string literal, use double quotes
|
||||||
.suggestion_whitespace = consider inserting whitespace here
|
.suggestion_whitespace = consider inserting whitespace here
|
||||||
|
|
||||||
parse_unknown_start_of_token = unknown start of token: {$escaped}
|
parse_unknown_start_of_token = unknown start of token: {$escaped}
|
||||||
|
|
|
@ -419,7 +419,7 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
|
||||||
.with_code(E0762);
|
.with_code(E0762);
|
||||||
if let Some(lt_sp) = self.last_lifetime {
|
if let Some(lt_sp) = self.last_lifetime {
|
||||||
err.multipart_suggestion(
|
err.multipart_suggestion(
|
||||||
"if you meant to write a `str` literal, use double quotes",
|
"if you meant to write a string literal, use double quotes",
|
||||||
vec![
|
vec![
|
||||||
(lt_sp, "\"".to_string()),
|
(lt_sp, "\"".to_string()),
|
||||||
(self.mk_sp(start, start + BytePos(1)), "\"".to_string()),
|
(self.mk_sp(start, start + BytePos(1)), "\"".to_string()),
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | let _: &str = '"""';
|
LL | let _: &str = '"""';
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let _: &str = "\"\"\"";
|
LL | let _: &str = "\"\"\"";
|
||||||
| ~~~~~~~~
|
| ~~~~~~~~
|
||||||
|
@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | let _: &str = '\"\"\"';
|
LL | let _: &str = '\"\"\"';
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let _: &str = "\"\"\"";
|
LL | let _: &str = "\"\"\"";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
@ -26,7 +26,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | let _: &str = '"\"\"\\"\\"';
|
LL | let _: &str = '"\"\"\\"\\"';
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let _: &str = "\"\"\\"\\"\\\"";
|
LL | let _: &str = "\"\"\\"\\"\\\"";
|
||||||
| ~~~~~~~~~~~~~~~~~~~~
|
| ~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -39,7 +39,7 @@ LL | let _: &str = 'a';
|
||||||
| |
|
| |
|
||||||
| expected due to this
|
| expected due to this
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let _: &str = "a";
|
LL | let _: &str = "a";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -15,7 +15,7 @@ error[E0308]: mismatched types
|
||||||
LL | let v: Vec(&str) = vec!['1', '2'];
|
LL | let v: Vec(&str) = vec!['1', '2'];
|
||||||
| ^^^ expected `&str`, found `char`
|
| ^^^ expected `&str`, found `char`
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let v: Vec(&str) = vec!["1", '2'];
|
LL | let v: Vec(&str) = vec!["1", '2'];
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | 'nope'
|
LL | 'nope'
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | "nope"
|
LL | "nope"
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | static c: char = '●●';
|
LL | static c: char = '●●';
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | static c: char = "●●";
|
LL | static c: char = "●●";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | let ch: &str = '●●';
|
LL | let ch: &str = '●●';
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let ch: &str = "●●";
|
LL | let ch: &str = "●●";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | static c: char = '\x10\x10';
|
LL | static c: char = '\x10\x10';
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | static c: char = "\x10\x10";
|
LL | static c: char = "\x10\x10";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | let ch: &str = '\x10\x10';
|
LL | let ch: &str = '\x10\x10';
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let ch: &str = "\x10\x10";
|
LL | let ch: &str = "\x10\x10";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | let x: &str = 'ab';
|
LL | let x: &str = 'ab';
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let x: &str = "ab";
|
LL | let x: &str = "ab";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | let y: char = 'cd';
|
LL | let y: char = 'cd';
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let y: char = "cd";
|
LL | let y: char = "cd";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
@ -26,7 +26,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | let z = 'ef';
|
LL | let z = 'ef';
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let z = "ef";
|
LL | let z = "ef";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0762]: unterminated character literal
|
||||||
LL | println!('1 + 1');
|
LL | println!('1 + 1');
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | println!("1 + 1");
|
LL | println!("1 + 1");
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | println!(' 1 + 1');
|
LL | println!(' 1 + 1');
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | println!(" 1 + 1");
|
LL | println!(" 1 + 1");
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0762]: unterminated character literal
|
||||||
LL | println!('hello world');
|
LL | println!('hello world');
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | println!("hello world");
|
LL | println!("hello world");
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -5,5 +5,5 @@ fn main() {
|
||||||
//~| HELP if you meant to write a byte string literal, use double quotes
|
//~| HELP if you meant to write a byte string literal, use double quotes
|
||||||
let _bar = 'hello';
|
let _bar = 'hello';
|
||||||
//~^ ERROR character literal may only contain one codepoint
|
//~^ ERROR character literal may only contain one codepoint
|
||||||
//~| HELP if you meant to write a `str` literal, use double quotes
|
//~| HELP if you meant to write a string literal, use double quotes
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | let _bar = 'hello';
|
LL | let _bar = 'hello';
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let _bar = "hello";
|
LL | let _bar = "hello";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -7,12 +7,12 @@ fn main() {
|
||||||
let _spade = "♠️";
|
let _spade = "♠️";
|
||||||
//~^ ERROR: character literal may only contain one codepoint
|
//~^ ERROR: character literal may only contain one codepoint
|
||||||
//~| NOTE: this `♠` is followed by the combining mark `\u{fe0f}`
|
//~| NOTE: this `♠` is followed by the combining mark `\u{fe0f}`
|
||||||
//~| HELP: if you meant to write a `str` literal, use double quotes
|
//~| HELP: if you meant to write a string literal, use double quotes
|
||||||
|
|
||||||
let _s = "ṩ̂̊";
|
let _s = "ṩ̂̊";
|
||||||
//~^ ERROR: character literal may only contain one codepoint
|
//~^ ERROR: character literal may only contain one codepoint
|
||||||
//~| NOTE: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
|
//~| NOTE: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
|
||||||
//~| HELP: if you meant to write a `str` literal, use double quotes
|
//~| HELP: if you meant to write a string literal, use double quotes
|
||||||
|
|
||||||
let _a = 'Å';
|
let _a = 'Å';
|
||||||
//~^ ERROR: character literal may only contain one codepoint
|
//~^ ERROR: character literal may only contain one codepoint
|
||||||
|
|
|
@ -7,12 +7,12 @@ fn main() {
|
||||||
let _spade = '♠️';
|
let _spade = '♠️';
|
||||||
//~^ ERROR: character literal may only contain one codepoint
|
//~^ ERROR: character literal may only contain one codepoint
|
||||||
//~| NOTE: this `♠` is followed by the combining mark `\u{fe0f}`
|
//~| NOTE: this `♠` is followed by the combining mark `\u{fe0f}`
|
||||||
//~| HELP: if you meant to write a `str` literal, use double quotes
|
//~| HELP: if you meant to write a string literal, use double quotes
|
||||||
|
|
||||||
let _s = 'ṩ̂̊';
|
let _s = 'ṩ̂̊';
|
||||||
//~^ ERROR: character literal may only contain one codepoint
|
//~^ ERROR: character literal may only contain one codepoint
|
||||||
//~| NOTE: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
|
//~| NOTE: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
|
||||||
//~| HELP: if you meant to write a `str` literal, use double quotes
|
//~| HELP: if you meant to write a string literal, use double quotes
|
||||||
|
|
||||||
let _a = 'Å';
|
let _a = 'Å';
|
||||||
//~^ ERROR: character literal may only contain one codepoint
|
//~^ ERROR: character literal may only contain one codepoint
|
||||||
|
|
|
@ -9,7 +9,7 @@ note: this `♠` is followed by the combining mark `\u{fe0f}`
|
||||||
|
|
|
|
||||||
LL | let _spade = '♠️';
|
LL | let _spade = '♠️';
|
||||||
| ^
|
| ^
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let _spade = "♠️";
|
LL | let _spade = "♠️";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
@ -25,7 +25,7 @@ note: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
|
||||||
|
|
|
|
||||||
LL | let _s = 'ṩ̂̊';
|
LL | let _s = 'ṩ̂̊';
|
||||||
| ^
|
| ^
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | let _s = "ṩ̂̊";
|
LL | let _s = "ṩ̂̊";
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
|
||||||
LL | println!('●●');
|
LL | println!('●●');
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
help: if you meant to write a `str` literal, use double quotes
|
help: if you meant to write a string literal, use double quotes
|
||||||
|
|
|
|
||||||
LL | println!("●●");
|
LL | println!("●●");
|
||||||
| ~ ~
|
| ~ ~
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue