Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #122959

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d3299af
transmute: caution against int2ptr transmutation
RalfJung Mar 12, 2024
982918f
Handle str literals written with `'` lexed as lifetime
estebank Mar 9, 2024
4a10b01
Use shorter span for existing `'` -> `"` structured suggestion
estebank Mar 9, 2024
999a0dc
review comment: `str` -> string in messages
estebank Mar 13, 2024
6f388ef
Extend test to trigger on 2015, 2018 and 2021 editions
estebank Mar 14, 2024
ea1883d
Silence redundant error on char literal that was meant to be a string…
estebank Mar 14, 2024
f4d30b1
fix rustdoc test
estebank Mar 17, 2024
f4adb1e
add notes on how to store 'ptr or int'
RalfJung Mar 14, 2024
2624e91
Soft-destabilize `RustcEncodable`/`RustcDecodable`
jhpratt Sep 21, 2023
fbf21c5
Remove RustcEncodable/Decodable from 2024 prelude
jhpratt Sep 21, 2023
1fcf2ea
Uniquify ReError on input mode in canonicalizer
compiler-errors Mar 22, 2024
da8a39a
Failing test
compiler-errors Mar 8, 2024
78ebb93
Fix validation on substituted callee bodies in MIR inliner
compiler-errors Mar 19, 2024
12e3629
add test for #99945
matthiaskrgr Mar 23, 2024
2f9a240
add test for opaque type with non-universal region substs #101852
matthiaskrgr Mar 23, 2024
e54bff7
add test for #104779 opaque types, patterns and subtyping ICE: Index…
matthiaskrgr Mar 23, 2024
f1f287f
add test for ICE "raw ptr comparison should already be caught in the…
matthiaskrgr Mar 23, 2024
f8aeac8
add test for #106423
matthiaskrgr Mar 23, 2024
cc422ce
add test for ICE #106444
matthiaskrgr Mar 23, 2024
f2bc9c5
add test for #106874 ICE BoundUniversalRegionError
matthiaskrgr Mar 23, 2024
368bfb2
add test for #107228
matthiaskrgr Mar 23, 2024
9aea37d
address review feedback
matthiaskrgr Mar 23, 2024
246f746
Add test in `higher-ranked`
Luv-Ray Mar 23, 2024
188c46a
regression test for #103626
kadiwa4 Feb 19, 2024
d959730
Rollup merge of #116016 - jhpratt:kill-rustc-serialize, r=dtolnay
matthiaskrgr Mar 23, 2024
e07a5aa
Rollup merge of #121281 - kadiwa4:test_103626, r=estebank,lcnr
matthiaskrgr Mar 23, 2024
d0e27af
Rollup merge of #122168 - compiler-errors:inline-coroutine-body-valid…
matthiaskrgr Mar 23, 2024
08bb35e
Rollup merge of #122217 - estebank:issue-119685, r=fmease
matthiaskrgr Mar 23, 2024
f68a0f1
Rollup merge of #122379 - RalfJung:int2ptr-transmute, r=m-ou-se
matthiaskrgr Mar 23, 2024
88574e1
Rollup merge of #122907 - compiler-errors:uniquify-reerror, r=lcnr
matthiaskrgr Mar 23, 2024
35310b7
Rollup merge of #122942 - Luv-Ray:master, r=lcnr
matthiaskrgr Mar 23, 2024
5f5362d
Rollup merge of #122943 - matthiaskrgr:ice-tests-9xxxx-to-12xxxx, r=f…
matthiaskrgr Mar 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review comment: str -> string in messages
  • Loading branch information
estebank committed Mar 17, 2024
commit 999a0dc300b7f95eb7d83666514c4ceae76020f2
2 changes: 1 addition & 1 deletion compiler/rustc_infer/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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_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_more_targeted = {$has_param_name ->
[true] `{$param_name}`
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_parse/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ parse_more_than_one_char = character literal may only contain one codepoint
.remove_non = consider removing the non-printing characters
.use_double_quotes = if you meant to write a {$is_byte ->
[true] byte string
*[false] `str`
*[false] string
} literal, use double quotes

parse_multiple_skipped_lines = multiple lines skipped by escaped newline
Expand Down Expand Up @@ -835,7 +835,7 @@ parse_unknown_prefix = prefix `{$prefix}` is unknown
.label = unknown prefix
.note = prefixed identifiers and literals are reserved since Rust 2021
.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

parse_unknown_start_of_token = unknown start of token: {$escaped}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
.with_code(E0762);
if let Some(lt_sp) = self.last_lifetime {
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![
(lt_sp, "\"".to_string()),
(self.mk_sp(start, start + BytePos(1)), "\"".to_string()),
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/inference/str-as-char.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
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 = "\"\"\"";
| ~~~~~~~~
Expand All @@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
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 = "\"\"\"";
| ~ ~
Expand All @@ -26,7 +26,7 @@ error: character literal may only contain one codepoint
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 = "\"\"\\"\\"\\\"";
| ~~~~~~~~~~~~~~~~~~~~
Expand All @@ -39,7 +39,7 @@ LL | let _: &str = 'a';
| |
| 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";
| ~ ~
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-23589.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ error[E0308]: mismatched types
LL | let v: Vec(&str) = vec!['1', '2'];
| ^^^ 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'];
| ~ ~
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lexer/lex-bad-char-literals-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
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"
| ~ ~
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/lexer/lex-bad-char-literals-3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
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 = "●●";
| ~ ~
Expand All @@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
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 = "●●";
| ~ ~
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/lexer/lex-bad-char-literals-5.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
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";
| ~ ~
Expand All @@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
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";
| ~ ~
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/lexer/lex-bad-char-literals-6.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
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";
| ~ ~
Expand All @@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
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";
| ~ ~
Expand All @@ -26,7 +26,7 @@ error: character literal may only contain one codepoint
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";
| ~ ~
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lexer/lex-bad-str-literal-as-char-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0762]: unterminated character literal
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");
| ~ ~
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lexer/lex-bad-str-literal-as-char-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
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");
| ~ ~
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lexer/lex-bad-str-literal-as-char-3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0762]: unterminated character literal
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");
| ~ ~
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/parser/issues/issue-64732.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ fn main() {
//~| HELP if you meant to write a byte string literal, use double quotes
let _bar = 'hello';
//~^ 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
}
2 changes: 1 addition & 1 deletion tests/ui/parser/issues/issue-64732.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ error: character literal may only contain one codepoint
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";
| ~ ~
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/parser/unicode-character-literal.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ fn main() {
let _spade = "♠️";
//~^ ERROR: character literal may only contain one codepoint
//~| 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 = "ṩ̂̊";
//~^ 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}`
//~| 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 = 'Å';
//~^ ERROR: character literal may only contain one codepoint
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/parser/unicode-character-literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ fn main() {
let _spade = '♠️';
//~^ ERROR: character literal may only contain one codepoint
//~| 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 = 'ṩ̂̊';
//~^ 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}`
//~| 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 = 'Å';
//~^ ERROR: character literal may only contain one codepoint
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/parser/unicode-character-literal.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: this `♠` is followed by the combining mark `\u{fe0f}`
|
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 = "♠️";
| ~ ~
Expand All @@ -25,7 +25,7 @@ note: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
|
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 = "ṩ̂̊";
| ~ ~
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/str/str-as-char.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: character literal may only contain one codepoint
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!("●●");
| ~ ~
Expand Down