Skip to content

Commit 999a0dc

Browse files
committed
review comment: str -> string in messages
1 parent 4a10b01 commit 999a0dc

18 files changed

+29
-29
lines changed

compiler/rustc_infer/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ infer_lifetime_param_suggestion_elided = each elided lifetime in input position
169169
170170
infer_meant_byte_literal = if you meant to write a byte literal, prefix with `b`
171171
infer_meant_char_literal = if you meant to write a `char` literal, use single quotes
172-
infer_meant_str_literal = if you meant to write a `str` literal, use double quotes
172+
infer_meant_str_literal = if you meant to write a string literal, use double quotes
173173
infer_mismatched_static_lifetime = incompatible lifetime on type
174174
infer_more_targeted = {$has_param_name ->
175175
[true] `{$param_name}`

compiler/rustc_parse/messages.ftl

+2-2
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ parse_more_than_one_char = character literal may only contain one codepoint
570570
.remove_non = consider removing the non-printing characters
571571
.use_double_quotes = if you meant to write a {$is_byte ->
572572
[true] byte string
573-
*[false] `str`
573+
*[false] string
574574
} literal, use double quotes
575575
576576
parse_multiple_skipped_lines = multiple lines skipped by escaped newline
@@ -835,7 +835,7 @@ parse_unknown_prefix = prefix `{$prefix}` is unknown
835835
.label = unknown prefix
836836
.note = prefixed identifiers and literals are reserved since Rust 2021
837837
.suggestion_br = use `br` for a raw byte string
838-
.suggestion_str = if you meant to write a `str` literal, use double quotes
838+
.suggestion_str = if you meant to write a string literal, use double quotes
839839
.suggestion_whitespace = consider inserting whitespace here
840840
841841
parse_unknown_start_of_token = unknown start of token: {$escaped}

compiler/rustc_parse/src/lexer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
419419
.with_code(E0762);
420420
if let Some(lt_sp) = self.last_lifetime {
421421
err.multipart_suggestion(
422-
"if you meant to write a `str` literal, use double quotes",
422+
"if you meant to write a string literal, use double quotes",
423423
vec![
424424
(lt_sp, "\"".to_string()),
425425
(self.mk_sp(start, start + BytePos(1)), "\"".to_string()),

tests/ui/inference/str-as-char.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
44
LL | let _: &str = '"""';
55
| ^^^^^
66
|
7-
help: if you meant to write a `str` literal, use double quotes
7+
help: if you meant to write a string literal, use double quotes
88
|
99
LL | let _: &str = "\"\"\"";
1010
| ~~~~~~~~
@@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
1515
LL | let _: &str = '\"\"\"';
1616
| ^^^^^^^^
1717
|
18-
help: if you meant to write a `str` literal, use double quotes
18+
help: if you meant to write a string literal, use double quotes
1919
|
2020
LL | let _: &str = "\"\"\"";
2121
| ~ ~
@@ -26,7 +26,7 @@ error: character literal may only contain one codepoint
2626
LL | let _: &str = '"\"\"\\"\\"';
2727
| ^^^^^^^^^^^^^^^^^
2828
|
29-
help: if you meant to write a `str` literal, use double quotes
29+
help: if you meant to write a string literal, use double quotes
3030
|
3131
LL | let _: &str = "\"\"\\"\\"\\\"";
3232
| ~~~~~~~~~~~~~~~~~~~~
@@ -39,7 +39,7 @@ LL | let _: &str = 'a';
3939
| |
4040
| expected due to this
4141
|
42-
help: if you meant to write a `str` literal, use double quotes
42+
help: if you meant to write a string literal, use double quotes
4343
|
4444
LL | let _: &str = "a";
4545
| ~ ~

tests/ui/issues/issue-23589.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
1515
LL | let v: Vec(&str) = vec!['1', '2'];
1616
| ^^^ expected `&str`, found `char`
1717
|
18-
help: if you meant to write a `str` literal, use double quotes
18+
help: if you meant to write a string literal, use double quotes
1919
|
2020
LL | let v: Vec(&str) = vec!["1", '2'];
2121
| ~ ~

tests/ui/lexer/lex-bad-char-literals-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
44
LL | 'nope'
55
| ^^^^^^
66
|
7-
help: if you meant to write a `str` literal, use double quotes
7+
help: if you meant to write a string literal, use double quotes
88
|
99
LL | "nope"
1010
| ~ ~

tests/ui/lexer/lex-bad-char-literals-3.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
44
LL | static c: char = '●●';
55
| ^^^^
66
|
7-
help: if you meant to write a `str` literal, use double quotes
7+
help: if you meant to write a string literal, use double quotes
88
|
99
LL | static c: char = "●●";
1010
| ~ ~
@@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
1515
LL | let ch: &str = '●●';
1616
| ^^^^
1717
|
18-
help: if you meant to write a `str` literal, use double quotes
18+
help: if you meant to write a string literal, use double quotes
1919
|
2020
LL | let ch: &str = "●●";
2121
| ~ ~

tests/ui/lexer/lex-bad-char-literals-5.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
44
LL | static c: char = '\x10\x10';
55
| ^^^^^^^^^^
66
|
7-
help: if you meant to write a `str` literal, use double quotes
7+
help: if you meant to write a string literal, use double quotes
88
|
99
LL | static c: char = "\x10\x10";
1010
| ~ ~
@@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
1515
LL | let ch: &str = '\x10\x10';
1616
| ^^^^^^^^^^
1717
|
18-
help: if you meant to write a `str` literal, use double quotes
18+
help: if you meant to write a string literal, use double quotes
1919
|
2020
LL | let ch: &str = "\x10\x10";
2121
| ~ ~

tests/ui/lexer/lex-bad-char-literals-6.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
44
LL | let x: &str = 'ab';
55
| ^^^^
66
|
7-
help: if you meant to write a `str` literal, use double quotes
7+
help: if you meant to write a string literal, use double quotes
88
|
99
LL | let x: &str = "ab";
1010
| ~ ~
@@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
1515
LL | let y: char = 'cd';
1616
| ^^^^
1717
|
18-
help: if you meant to write a `str` literal, use double quotes
18+
help: if you meant to write a string literal, use double quotes
1919
|
2020
LL | let y: char = "cd";
2121
| ~ ~
@@ -26,7 +26,7 @@ error: character literal may only contain one codepoint
2626
LL | let z = 'ef';
2727
| ^^^^
2828
|
29-
help: if you meant to write a `str` literal, use double quotes
29+
help: if you meant to write a string literal, use double quotes
3030
|
3131
LL | let z = "ef";
3232
| ~ ~

tests/ui/lexer/lex-bad-str-literal-as-char-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0762]: unterminated character literal
44
LL | println!('1 + 1');
55
| ^^^
66
|
7-
help: if you meant to write a `str` literal, use double quotes
7+
help: if you meant to write a string literal, use double quotes
88
|
99
LL | println!("1 + 1");
1010
| ~ ~

tests/ui/lexer/lex-bad-str-literal-as-char-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
44
LL | println!(' 1 + 1');
55
| ^^^^^^^^
66
|
7-
help: if you meant to write a `str` literal, use double quotes
7+
help: if you meant to write a string literal, use double quotes
88
|
99
LL | println!(" 1 + 1");
1010
| ~ ~

tests/ui/lexer/lex-bad-str-literal-as-char-3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0762]: unterminated character literal
44
LL | println!('hello world');
55
| ^^^^
66
|
7-
help: if you meant to write a `str` literal, use double quotes
7+
help: if you meant to write a string literal, use double quotes
88
|
99
LL | println!("hello world");
1010
| ~ ~

tests/ui/parser/issues/issue-64732.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ fn main() {
55
//~| HELP if you meant to write a byte string literal, use double quotes
66
let _bar = 'hello';
77
//~^ ERROR character literal may only contain one codepoint
8-
//~| HELP if you meant to write a `str` literal, use double quotes
8+
//~| HELP if you meant to write a string literal, use double quotes
99
}

tests/ui/parser/issues/issue-64732.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
1515
LL | let _bar = 'hello';
1616
| ^^^^^^^
1717
|
18-
help: if you meant to write a `str` literal, use double quotes
18+
help: if you meant to write a string literal, use double quotes
1919
|
2020
LL | let _bar = "hello";
2121
| ~ ~

tests/ui/parser/unicode-character-literal.fixed

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ fn main() {
77
let _spade = "♠️";
88
//~^ ERROR: character literal may only contain one codepoint
99
//~| NOTE: this `♠` is followed by the combining mark `\u{fe0f}`
10-
//~| HELP: if you meant to write a `str` literal, use double quotes
10+
//~| HELP: if you meant to write a string literal, use double quotes
1111

1212
let _s = "ṩ̂̊";
1313
//~^ ERROR: character literal may only contain one codepoint
1414
//~| NOTE: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
15-
//~| HELP: if you meant to write a `str` literal, use double quotes
15+
//~| HELP: if you meant to write a string literal, use double quotes
1616

1717
let _a = 'Å';
1818
//~^ ERROR: character literal may only contain one codepoint

tests/ui/parser/unicode-character-literal.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ fn main() {
77
let _spade = '♠️';
88
//~^ ERROR: character literal may only contain one codepoint
99
//~| NOTE: this `♠` is followed by the combining mark `\u{fe0f}`
10-
//~| HELP: if you meant to write a `str` literal, use double quotes
10+
//~| HELP: if you meant to write a string literal, use double quotes
1111

1212
let _s = 'ṩ̂̊';
1313
//~^ ERROR: character literal may only contain one codepoint
1414
//~| NOTE: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
15-
//~| HELP: if you meant to write a `str` literal, use double quotes
15+
//~| HELP: if you meant to write a string literal, use double quotes
1616

1717
let _a = '';
1818
//~^ ERROR: character literal may only contain one codepoint

tests/ui/parser/unicode-character-literal.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: this `♠` is followed by the combining mark `\u{fe0f}`
99
|
1010
LL | let _spade = '♠️';
1111
| ^
12-
help: if you meant to write a `str` literal, use double quotes
12+
help: if you meant to write a string literal, use double quotes
1313
|
1414
LL | let _spade = "♠️";
1515
| ~ ~
@@ -25,7 +25,7 @@ note: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
2525
|
2626
LL | let _s = 'ṩ̂̊';
2727
| ^
28-
help: if you meant to write a `str` literal, use double quotes
28+
help: if you meant to write a string literal, use double quotes
2929
|
3030
LL | let _s = "ṩ̂̊";
3131
| ~ ~

tests/ui/str/str-as-char.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
44
LL | println!('●●');
55
| ^^^^
66
|
7-
help: if you meant to write a `str` literal, use double quotes
7+
help: if you meant to write a string literal, use double quotes
88
|
99
LL | println!("●●");
1010
| ~ ~

0 commit comments

Comments
 (0)