From b1b6e0c41a09cdcfbd8a731e5489eb56df33d7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Thu, 25 Jan 2024 06:40:07 +0200 Subject: [PATCH 1/3] Reapply "Detect `NulInCStr` error earlier." This reverts commit 0ea056552a014a09b7aed40358f05c0676460af5. --- crates/parser/src/lexed_str.rs | 1 + crates/syntax/src/validation.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/crates/parser/src/lexed_str.rs b/crates/parser/src/lexed_str.rs index f47ec49df1d9..aa25f82ae1d8 100644 --- a/crates/parser/src/lexed_str.rs +++ b/crates/parser/src/lexed_str.rs @@ -369,6 +369,7 @@ fn error_to_diagnostic_message(error: EscapeError, mode: Mode) -> &'static str { "non-ASCII character in byte string literal" } EscapeError::NonAsciiCharInByte => "non-ASCII character in raw byte string literal", + EscapeError::NulInCStr => "null character in C string literal", EscapeError::UnskippedWhitespaceWarning => "", EscapeError::MultipleSkippedLinesWarning => "", } diff --git a/crates/syntax/src/validation.rs b/crates/syntax/src/validation.rs index 6c6916c585f1..69dffbf79f19 100644 --- a/crates/syntax/src/validation.rs +++ b/crates/syntax/src/validation.rs @@ -106,6 +106,9 @@ fn rustc_unescape_error_to_string(err: unescape::EscapeError) -> (&'static str, EE::NonAsciiCharInByte => { "Byte literals must not contain non-ASCII characters" } + EE::NulInCStr => { + "C strings literals must not contain null characters" + } EE::UnskippedWhitespaceWarning => "Whitespace after this escape is not skipped", EE::MultipleSkippedLinesWarning => "Multiple lines are skipped by this escape", From b1b99cbcf90b5d1825e91f21d65445773b2cd7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Thu, 25 Jan 2024 06:42:48 +0200 Subject: [PATCH 2/3] Bump rustc_lexer and rustc_parse_format --- Cargo.lock | 10 +++++----- Cargo.toml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bdb9feee5f12..5578334e22cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1476,9 +1476,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_lexer" -version = "0.21.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc741c7a78103efab416b562e35bd73c8d4967478575010c86c6062f8d3cbf29" +checksum = "d2d221356e5717595e8a0afa5fba1620dcb4032ab784dc4d98fdc7284e3feb66" dependencies = [ "unicode-properties", "unicode-xid", @@ -1486,11 +1486,11 @@ dependencies = [ [[package]] name = "ra-ap-rustc_parse_format" -version = "0.21.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d557201d71792487bd2bab637ab5be9aa6fff59b88e25e12de180b0f9d2df60f" +checksum = "ab62fc925612374103b4f178da347b535b35d9eb1ff5ba42105c990b2e25a164" dependencies = [ - "ra-ap-rustc_index 0.21.0", + "ra-ap-rustc_index 0.33.0", "ra-ap-rustc_lexer", ] diff --git a/Cargo.toml b/Cargo.toml index ed5b2eb9b2d5..478304c709bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,8 +79,8 @@ tt = { path = "./crates/tt", version = "0.0.0" } vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" } vfs = { path = "./crates/vfs", version = "0.0.0" } -ra-ap-rustc_lexer = { version = "0.21.0", default-features = false } -ra-ap-rustc_parse_format = { version = "0.21.0", default-features = false } +ra-ap-rustc_lexer = { version = "0.33.0", default-features = false } +ra-ap-rustc_parse_format = { version = "0.33.0", default-features = false } ra-ap-rustc_index = { version = "0.21.0", default-features = false } ra-ap-rustc_abi = { version = "0.21.0", default-features = false } ra-ap-rustc_pattern_analysis = { version = "0.33.0", default-features = false } From ea94c10db01df312bb34f9b126f21129cb239e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Thu, 25 Jan 2024 06:44:13 +0200 Subject: [PATCH 3/3] Bump rustc_index and rustc_abi --- Cargo.lock | 39 ++++++++------------------------------- Cargo.toml | 4 ++-- 2 files changed, 10 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5578334e22cc..7513abf17c8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,7 +592,7 @@ dependencies = [ "profile", "project-model", "ra-ap-rustc_abi", - "ra-ap-rustc_index 0.21.0", + "ra-ap-rustc_index", "ra-ap-rustc_pattern_analysis", "rustc-hash", "scoped-tls", @@ -1419,26 +1419,15 @@ dependencies = [ [[package]] name = "ra-ap-rustc_abi" -version = "0.21.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7816f980fab89e878ff2e916e2077d484e3aa1c619a3cc982c8a417c3dfe45fa" +checksum = "8ce9100fc66c6c60aeeb076868ead9c2eaa65d6a5a90404f08c242327a92ff4b" dependencies = [ - "bitflags 1.3.2", - "ra-ap-rustc_index 0.21.0", + "bitflags 2.4.1", + "ra-ap-rustc_index", "tracing", ] -[[package]] -name = "ra-ap-rustc_index" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8352918d61aa4afab9f2ed7314cf638976b20949b3d61d2f468c975b0d251f24" -dependencies = [ - "arrayvec", - "ra-ap-rustc_index_macros 0.21.0", - "smallvec", -] - [[package]] name = "ra-ap-rustc_index" version = "0.33.0" @@ -1446,22 +1435,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5313d7f243b63ef9e58d94355b11aa8499f1328055f1f58adf0a5ea7d2faca" dependencies = [ "arrayvec", - "ra-ap-rustc_index_macros 0.33.0", + "ra-ap-rustc_index_macros", "smallvec", ] -[[package]] -name = "ra-ap-rustc_index_macros" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a9424018828155a3e3596515598f90e68427d8f35eff6df7f0856c73fc58a8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", - "synstructure", -] - [[package]] name = "ra-ap-rustc_index_macros" version = "0.33.0" @@ -1490,7 +1467,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab62fc925612374103b4f178da347b535b35d9eb1ff5ba42105c990b2e25a164" dependencies = [ - "ra-ap-rustc_index 0.33.0", + "ra-ap-rustc_index", "ra-ap-rustc_lexer", ] @@ -1501,7 +1478,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c4085e0c771fd4b883930b599ef42966b855762bbe4052c17673b3253421a6d" dependencies = [ "derivative", - "ra-ap-rustc_index 0.33.0", + "ra-ap-rustc_index", "rustc-hash", "rustc_apfloat", "smallvec", diff --git a/Cargo.toml b/Cargo.toml index 478304c709bc..56db5a28c08a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,8 +81,8 @@ vfs = { path = "./crates/vfs", version = "0.0.0" } ra-ap-rustc_lexer = { version = "0.33.0", default-features = false } ra-ap-rustc_parse_format = { version = "0.33.0", default-features = false } -ra-ap-rustc_index = { version = "0.21.0", default-features = false } -ra-ap-rustc_abi = { version = "0.21.0", default-features = false } +ra-ap-rustc_index = { version = "0.33.0", default-features = false } +ra-ap-rustc_abi = { version = "0.33.0", default-features = false } ra-ap-rustc_pattern_analysis = { version = "0.33.0", default-features = false } # local crates that aren't published to crates.io. These should not have versions.