From 13f11301cca43f81337aae7e5b1c16a5bd7cf278 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Tue, 2 Jan 2024 15:27:05 -0600 Subject: [PATCH 1/3] Revert "Stabilize C string literals" This reverts commit 0f41bc21b958fed66b3d055531af67638390f520. --- compiler/rustc_ast_passes/src/feature_gate.rs | 1 + .../rustc_builtin_macros/src/concat_bytes.rs | 4 +-- compiler/rustc_feature/src/accepted.rs | 2 -- compiler/rustc_feature/src/unstable.rs | 2 ++ compiler/rustc_parse/src/lexer/mod.rs | 3 ++ .../clippy/tests/ui/needless_raw_string.fixed | 1 + .../clippy/tests/ui/needless_raw_string.rs | 1 + .../tests/ui/needless_raw_string.stderr | 14 ++++---- .../tests/ui/needless_raw_string_hashes.fixed | 1 + .../tests/ui/needless_raw_string_hashes.rs | 1 + .../ui/needless_raw_string_hashes.stderr | 30 +++++++++--------- tests/ui/proc-macro/literal-to-string.rs | 1 + tests/ui/proc-macro/literal-to-string.stdout | 30 +++++++++--------- .../rfcs/rfc-3348-c-string-literals/basic.rs | 2 ++ .../rfcs/rfc-3348-c-string-literals/gate.rs | 15 +++++++++ .../rfc-3348-c-string-literals/gate.stderr | 21 ++++++++++++ .../rfc-3348-c-string-literals/no-nuls.rs | Bin 738 -> 767 bytes .../rfc-3348-c-string-literals/no-nuls.stderr | Bin 674 -> 674 bytes .../rfc-3348-c-string-literals/non-ascii.rs | 2 ++ 19 files changed, 90 insertions(+), 41 deletions(-) create mode 100644 tests/ui/rfcs/rfc-3348-c-string-literals/gate.rs create mode 100644 tests/ui/rfcs/rfc-3348-c-string-literals/gate.stderr diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 142cdd15e64ac..6900d339295df 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -515,6 +515,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { } }; } + gate_all!(c_str_literals, "`c\"..\"` literals are experimental"); gate_all!( if_let_guard, "`if let` guards are experimental", diff --git a/compiler/rustc_builtin_macros/src/concat_bytes.rs b/compiler/rustc_builtin_macros/src/concat_bytes.rs index 96e9584c20955..5499852e1770c 100644 --- a/compiler/rustc_builtin_macros/src/concat_bytes.rs +++ b/compiler/rustc_builtin_macros/src/concat_bytes.rs @@ -19,8 +19,8 @@ fn invalid_type_err( let snippet = cx.sess.source_map().span_to_snippet(span).ok(); match ast::LitKind::from_token_lit(token_lit) { Ok(ast::LitKind::CStr(_, _)) => { - // Avoid ambiguity in handling of terminal `NUL` by refusing to - // concatenate C string literals as bytes. + // FIXME(c_str_literals): should concatenation of C string literals + // include the null bytes in the end? cx.emit_err(errors::ConcatCStrLit { span: span }); } Ok(ast::LitKind::Char(_)) => { diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index aa0db9891a5ad..51ee56080a2ce 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -76,8 +76,6 @@ declare_features! ( (accepted, bindings_after_at, "1.56.0", Some(65490)), /// Allows empty structs and enum variants with braces. (accepted, braced_empty_structs, "1.8.0", Some(29720)), - /// Allows `c"foo"` literals. - (accepted, c_str_literals, "1.76.0", Some(105723)), /// Allows `#[cfg_attr(predicate, multiple, attributes, here)]`. (accepted, cfg_attr_multi, "1.33.0", Some(54881)), /// Allows the use of `#[cfg(doctest)]`, set when rustdoc is collecting doctests. diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 38c40471e29f2..1ad75a692c7cd 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -359,6 +359,8 @@ declare_features! ( (unstable, async_fn_track_caller, "1.73.0", Some(110011)), /// Allows builtin # foo() syntax (unstable, builtin_syntax, "1.71.0", Some(110680)), + /// Allows `c"foo"` literals. + (unstable, c_str_literals, "1.71.0", Some(105723)), /// Treat `extern "C"` function as nounwind. (unstable, c_unwind, "1.52.0", Some(74990)), /// Allows using C-variadics. diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index c158edaac2554..a91fbdff4a00e 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -223,6 +223,9 @@ impl<'a> StringReader<'a> { rustc_lexer::TokenKind::Literal { kind, suffix_start } => { let suffix_start = start + BytePos(suffix_start); let (kind, symbol) = self.cook_lexer_literal(start, suffix_start, kind); + if let token::LitKind::CStr | token::LitKind::CStrRaw(_) = kind { + self.sess.gated_spans.gate(sym::c_str_literals, self.mk_sp(start, self.pos)); + } let suffix = if suffix_start < self.pos { let string = self.str_from(suffix_start); if string == "_" { diff --git a/src/tools/clippy/tests/ui/needless_raw_string.fixed b/src/tools/clippy/tests/ui/needless_raw_string.fixed index 1a9c601c462ba..4ea711fd67a14 100644 --- a/src/tools/clippy/tests/ui/needless_raw_string.fixed +++ b/src/tools/clippy/tests/ui/needless_raw_string.fixed @@ -1,5 +1,6 @@ #![allow(clippy::needless_raw_string_hashes, clippy::no_effect, unused)] #![warn(clippy::needless_raw_strings)] +#![feature(c_str_literals)] fn main() { "aaa"; diff --git a/src/tools/clippy/tests/ui/needless_raw_string.rs b/src/tools/clippy/tests/ui/needless_raw_string.rs index 1126ea5aa3033..b6239f9b1f031 100644 --- a/src/tools/clippy/tests/ui/needless_raw_string.rs +++ b/src/tools/clippy/tests/ui/needless_raw_string.rs @@ -1,5 +1,6 @@ #![allow(clippy::needless_raw_string_hashes, clippy::no_effect, unused)] #![warn(clippy::needless_raw_strings)] +#![feature(c_str_literals)] fn main() { r#"aaa"#; diff --git a/src/tools/clippy/tests/ui/needless_raw_string.stderr b/src/tools/clippy/tests/ui/needless_raw_string.stderr index b2188698564f9..276bc84c6c375 100644 --- a/src/tools/clippy/tests/ui/needless_raw_string.stderr +++ b/src/tools/clippy/tests/ui/needless_raw_string.stderr @@ -1,5 +1,5 @@ error: unnecessary raw string literal - --> $DIR/needless_raw_string.rs:5:5 + --> $DIR/needless_raw_string.rs:6:5 | LL | r#"aaa"#; | ^^^^^^^^ @@ -13,7 +13,7 @@ LL + "aaa"; | error: unnecessary raw string literal - --> $DIR/needless_raw_string.rs:8:5 + --> $DIR/needless_raw_string.rs:9:5 | LL | br#"aaa"#; | ^^^^^^^^^ @@ -25,7 +25,7 @@ LL + b"aaa"; | error: unnecessary raw string literal - --> $DIR/needless_raw_string.rs:11:5 + --> $DIR/needless_raw_string.rs:12:5 | LL | cr#"aaa"#; | ^^^^^^^^^ @@ -37,7 +37,7 @@ LL + c"aaa"; | error: unnecessary raw string literal - --> $DIR/needless_raw_string.rs:15:5 + --> $DIR/needless_raw_string.rs:16:5 | LL | / r#" LL | | a @@ -56,7 +56,7 @@ LL ~ "; | error: unnecessary raw string literal - --> $DIR/needless_raw_string.rs:21:5 + --> $DIR/needless_raw_string.rs:22:5 | LL | r"no hashes"; | ^^^^^^^^^^^^ @@ -68,7 +68,7 @@ LL + "no hashes"; | error: unnecessary raw string literal - --> $DIR/needless_raw_string.rs:22:5 + --> $DIR/needless_raw_string.rs:23:5 | LL | br"no hashes"; | ^^^^^^^^^^^^^ @@ -80,7 +80,7 @@ LL + b"no hashes"; | error: unnecessary raw string literal - --> $DIR/needless_raw_string.rs:23:5 + --> $DIR/needless_raw_string.rs:24:5 | LL | cr"no hashes"; | ^^^^^^^^^^^^^ diff --git a/src/tools/clippy/tests/ui/needless_raw_string_hashes.fixed b/src/tools/clippy/tests/ui/needless_raw_string_hashes.fixed index b2ad657d6b29f..c99c2f46532a3 100644 --- a/src/tools/clippy/tests/ui/needless_raw_string_hashes.fixed +++ b/src/tools/clippy/tests/ui/needless_raw_string_hashes.fixed @@ -1,5 +1,6 @@ #![allow(clippy::no_effect, unused)] #![warn(clippy::needless_raw_string_hashes)] +#![feature(c_str_literals)] fn main() { r"\aaa"; diff --git a/src/tools/clippy/tests/ui/needless_raw_string_hashes.rs b/src/tools/clippy/tests/ui/needless_raw_string_hashes.rs index 54d8ed76d4751..dcc2af69f4e9c 100644 --- a/src/tools/clippy/tests/ui/needless_raw_string_hashes.rs +++ b/src/tools/clippy/tests/ui/needless_raw_string_hashes.rs @@ -1,5 +1,6 @@ #![allow(clippy::no_effect, unused)] #![warn(clippy::needless_raw_string_hashes)] +#![feature(c_str_literals)] fn main() { r#"\aaa"#; diff --git a/src/tools/clippy/tests/ui/needless_raw_string_hashes.stderr b/src/tools/clippy/tests/ui/needless_raw_string_hashes.stderr index c74eff8161e94..017160b1a421d 100644 --- a/src/tools/clippy/tests/ui/needless_raw_string_hashes.stderr +++ b/src/tools/clippy/tests/ui/needless_raw_string_hashes.stderr @@ -1,5 +1,5 @@ error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:5:5 + --> $DIR/needless_raw_string_hashes.rs:6:5 | LL | r#"\aaa"#; | ^^^^^^^^^ @@ -13,7 +13,7 @@ LL + r"\aaa"; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:6:5 + --> $DIR/needless_raw_string_hashes.rs:7:5 | LL | r##"Hello "world"!"##; | ^^^^^^^^^^^^^^^^^^^^^ @@ -25,7 +25,7 @@ LL + r#"Hello "world"!"#; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:7:5 + --> $DIR/needless_raw_string_hashes.rs:8:5 | LL | r######" "### "## "# "######; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -37,7 +37,7 @@ LL + r####" "### "## "# "####; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:8:5 + --> $DIR/needless_raw_string_hashes.rs:9:5 | LL | r######" "aa" "# "## "######; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -49,7 +49,7 @@ LL + r###" "aa" "# "## "###; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:9:5 + --> $DIR/needless_raw_string_hashes.rs:10:5 | LL | br#"\aaa"#; | ^^^^^^^^^^ @@ -61,7 +61,7 @@ LL + br"\aaa"; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:10:5 + --> $DIR/needless_raw_string_hashes.rs:11:5 | LL | br##"Hello "world"!"##; | ^^^^^^^^^^^^^^^^^^^^^^ @@ -73,7 +73,7 @@ LL + br#"Hello "world"!"#; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:11:5 + --> $DIR/needless_raw_string_hashes.rs:12:5 | LL | br######" "### "## "# "######; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -85,7 +85,7 @@ LL + br####" "### "## "# "####; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:12:5 + --> $DIR/needless_raw_string_hashes.rs:13:5 | LL | br######" "aa" "# "## "######; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -97,7 +97,7 @@ LL + br###" "aa" "# "## "###; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:13:5 + --> $DIR/needless_raw_string_hashes.rs:14:5 | LL | cr#"\aaa"#; | ^^^^^^^^^^ @@ -109,7 +109,7 @@ LL + cr"\aaa"; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:14:5 + --> $DIR/needless_raw_string_hashes.rs:15:5 | LL | cr##"Hello "world"!"##; | ^^^^^^^^^^^^^^^^^^^^^^ @@ -121,7 +121,7 @@ LL + cr#"Hello "world"!"#; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:15:5 + --> $DIR/needless_raw_string_hashes.rs:16:5 | LL | cr######" "### "## "# "######; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -133,7 +133,7 @@ LL + cr####" "### "## "# "####; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:16:5 + --> $DIR/needless_raw_string_hashes.rs:17:5 | LL | cr######" "aa" "# "## "######; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -145,7 +145,7 @@ LL + cr###" "aa" "# "## "###; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:18:5 + --> $DIR/needless_raw_string_hashes.rs:19:5 | LL | / r#" LL | | \a @@ -164,7 +164,7 @@ LL ~ "; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:24:5 + --> $DIR/needless_raw_string_hashes.rs:25:5 | LL | r###"rust"###; | ^^^^^^^^^^^^^ @@ -176,7 +176,7 @@ LL + r"rust"; | error: unnecessary hashes around raw string literal - --> $DIR/needless_raw_string_hashes.rs:25:5 + --> $DIR/needless_raw_string_hashes.rs:26:5 | LL | r#"hello world"#; | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/proc-macro/literal-to-string.rs b/tests/ui/proc-macro/literal-to-string.rs index eb009036a9a83..494d17cbeeaff 100644 --- a/tests/ui/proc-macro/literal-to-string.rs +++ b/tests/ui/proc-macro/literal-to-string.rs @@ -1,5 +1,6 @@ // check-pass // edition: 2021 +#![feature(c_str_literals)] // aux-build: print-tokens.rs extern crate print_tokens; diff --git a/tests/ui/proc-macro/literal-to-string.stdout b/tests/ui/proc-macro/literal-to-string.stdout index ec6427545f45c..7b27fcf798b12 100644 --- a/tests/ui/proc-macro/literal-to-string.stdout +++ b/tests/ui/proc-macro/literal-to-string.stdout @@ -3,91 +3,91 @@ TokenStream [ kind: Integer, symbol: "1", suffix: None, - span: #0 bytes(144..145), + span: #0 bytes(172..173), }, Literal { kind: Integer, symbol: "17", suffix: Some("u8"), - span: #0 bytes(154..158), + span: #0 bytes(182..186), }, Literal { kind: Float, symbol: "42.", suffix: None, - span: #0 bytes(167..170), + span: #0 bytes(195..198), }, Literal { kind: Float, symbol: "3.14", suffix: Some("f32"), - span: #0 bytes(179..186), + span: #0 bytes(207..214), }, Literal { kind: Byte, symbol: "a", suffix: None, - span: #0 bytes(195..199), + span: #0 bytes(223..227), }, Literal { kind: Byte, symbol: "\xFF", suffix: None, - span: #0 bytes(208..215), + span: #0 bytes(236..243), }, Literal { kind: Char, symbol: "c", suffix: None, - span: #0 bytes(224..227), + span: #0 bytes(252..255), }, Literal { kind: Char, symbol: "\x32", suffix: None, - span: #0 bytes(236..242), + span: #0 bytes(264..270), }, Literal { kind: Str, symbol: "\\"str\\"", suffix: None, - span: #0 bytes(251..260), + span: #0 bytes(279..288), }, Literal { kind: StrRaw(1), symbol: "\"raw\" str", suffix: None, - span: #0 bytes(269..283), + span: #0 bytes(297..311), }, Literal { kind: StrRaw(3), symbol: "very ##\"raw\"## str", suffix: None, - span: #0 bytes(292..319), + span: #0 bytes(320..347), }, Literal { kind: ByteStr, symbol: "\\"byte\\" str", suffix: None, - span: #0 bytes(328..343), + span: #0 bytes(356..371), }, Literal { kind: ByteStrRaw(1), symbol: "\"raw\" \"byte\" str", suffix: None, - span: #0 bytes(352..374), + span: #0 bytes(380..402), }, Literal { kind: CStr, symbol: "\\"c\\" str", suffix: None, - span: #0 bytes(383..395), + span: #0 bytes(411..423), }, Literal { kind: CStrRaw(1), symbol: "\"raw\" \"c\" str", suffix: None, - span: #0 bytes(404..423), + span: #0 bytes(432..451), }, ] 1 diff --git a/tests/ui/rfcs/rfc-3348-c-string-literals/basic.rs b/tests/ui/rfcs/rfc-3348-c-string-literals/basic.rs index 5609dc51a67ed..5037396000bf0 100644 --- a/tests/ui/rfcs/rfc-3348-c-string-literals/basic.rs +++ b/tests/ui/rfcs/rfc-3348-c-string-literals/basic.rs @@ -1,6 +1,8 @@ // run-pass // edition: 2021 +#![feature(c_str_literals)] + fn main() { assert_eq!(b"test\0", c"test".to_bytes_with_nul()); } diff --git a/tests/ui/rfcs/rfc-3348-c-string-literals/gate.rs b/tests/ui/rfcs/rfc-3348-c-string-literals/gate.rs new file mode 100644 index 0000000000000..ddd6d9a25daad --- /dev/null +++ b/tests/ui/rfcs/rfc-3348-c-string-literals/gate.rs @@ -0,0 +1,15 @@ +// gate-test-c_str_literals +// known-bug: #113333 +// edition: 2021 + +macro_rules! m { + ($t:tt) => {} +} + +fn main() { + c"foo"; + // FIXME(c_str_literals): This should be ``c".."` literals are experimental` + + m!(c"test"); + // FIXME(c_str_literals): This should be ``c".."` literals are experimental` +} diff --git a/tests/ui/rfcs/rfc-3348-c-string-literals/gate.stderr b/tests/ui/rfcs/rfc-3348-c-string-literals/gate.stderr new file mode 100644 index 0000000000000..ea666e4330830 --- /dev/null +++ b/tests/ui/rfcs/rfc-3348-c-string-literals/gate.stderr @@ -0,0 +1,21 @@ +error[E0658]: `c".."` literals are experimental + --> $DIR/gate.rs:10:5 + | +LL | c"foo"; + | ^^^^^^ + | + = note: see issue #105723 for more information + = help: add `#![feature(c_str_literals)]` to the crate attributes to enable + +error[E0658]: `c".."` literals are experimental + --> $DIR/gate.rs:13:8 + | +LL | m!(c"test"); + | ^^^^^^^ + | + = note: see issue #105723 for more information + = help: add `#![feature(c_str_literals)]` to the crate attributes to enable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/rfcs/rfc-3348-c-string-literals/no-nuls.rs b/tests/ui/rfcs/rfc-3348-c-string-literals/no-nuls.rs index e20ca50b88f905d5a0332a71f64d02c061f21711..dc1bf804548c2025f45e955760697d231a639dd4 100644 GIT binary patch delta 54 zcmaFF`kz%-Utb|LC9@ui%VHCIxRJ^q_ikiBRRgfq$oZovm~`BF{fBF JcB8;0CII8X5?%lR delta 25 gcmey*`iNCPUtb|LC9@OqwXap0B-sSHvj+t diff --git a/tests/ui/rfcs/rfc-3348-c-string-literals/no-nuls.stderr b/tests/ui/rfcs/rfc-3348-c-string-literals/no-nuls.stderr index ff9006f6f97f1be7eed18d188e8c30ba2075743e..82d9f9cb3209164b185951574f52ddf533680441 100644 GIT binary patch delta 39 vcmZ3)x`=f`$mBpK;fd*)jFuBGwlEq^yeK?5lQEsqbn->U21bj?K}-Pv6GRO} delta 40 wcmZ3)x`=f`2&2iwiy{*<(;3YtUTk4Bn0QfmawcOsqw(a6j17!tlY^K704fm;?f?J) diff --git a/tests/ui/rfcs/rfc-3348-c-string-literals/non-ascii.rs b/tests/ui/rfcs/rfc-3348-c-string-literals/non-ascii.rs index 8a5f514db7f61..380445d7a7fb9 100644 --- a/tests/ui/rfcs/rfc-3348-c-string-literals/non-ascii.rs +++ b/tests/ui/rfcs/rfc-3348-c-string-literals/non-ascii.rs @@ -1,6 +1,8 @@ // run-pass // edition: 2021 +#![feature(c_str_literals)] + fn main() { assert_eq!( c"\xEF\x80🦀\u{1F980}".to_bytes_with_nul(), From 99aa435b701f6f679b36cbf7c794cfb701988b68 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Tue, 2 Jan 2024 16:57:51 -0600 Subject: [PATCH 2/3] Fix fallout of making c_str_literals unstable again --- compiler/rustc_codegen_llvm/src/lib.rs | 2 +- library/std/src/lib.rs | 2 +- tests/ui-fulldeps/stable-mir/check_allocation.rs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 3c42eb21d0745..ed0d853e71561 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -8,7 +8,7 @@ #![feature(rustdoc_internals)] #![doc(rust_logo)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] -#![cfg_attr(bootstrap, feature(c_str_literals))] +#![feature(c_str_literals)] #![feature(exact_size_is_empty)] #![feature(extern_types)] #![feature(hash_raw_entry)] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 76081833e05eb..34b381b6c8366 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -308,7 +308,7 @@ // // Library features (core): // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(c_str_literals))] +#![feature(c_str_literals)] #![feature(char_internals)] #![feature(core_intrinsics)] #![feature(core_io_borrowed_buf)] diff --git a/tests/ui-fulldeps/stable-mir/check_allocation.rs b/tests/ui-fulldeps/stable-mir/check_allocation.rs index 7ce3597206b62..b13f76452fe01 100644 --- a/tests/ui-fulldeps/stable-mir/check_allocation.rs +++ b/tests/ui-fulldeps/stable-mir/check_allocation.rs @@ -12,6 +12,7 @@ #![feature(assert_matches)] #![feature(control_flow_enum)] #![feature(ascii_char, ascii_char_variants)] +#![feature(c_str_literals)] extern crate rustc_hir; extern crate rustc_middle; @@ -239,6 +240,7 @@ fn generate_input(path: &str) -> std::io::Result<()> { file, r#" #![feature(core_intrinsics)] + #![feature(c_str_literals)] use std::intrinsics::type_id; static LEN: usize = 2; From b2d48cad85be5d6034be0411dc12d78b0cd10841 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Mon, 8 Jan 2024 17:54:56 -0600 Subject: [PATCH 3/3] Revert reference and edition-guide c-str literal changes --- src/doc/edition-guide | 2 +- src/doc/reference | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/edition-guide b/src/doc/edition-guide index bbffb074e16be..db882044c8859 160000 --- a/src/doc/edition-guide +++ b/src/doc/edition-guide @@ -1 +1 @@ -Subproject commit bbffb074e16bef89772818b400b6c76a65eac126 +Subproject commit db882044c885973c0227bbddd3d4d76842a65b39 diff --git a/src/doc/reference b/src/doc/reference index f9f5b5babd955..752d3650b106b 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit f9f5b5babd95515e7028c32d6ca4d9790f64c146 +Subproject commit 752d3650b106b06f9ea6ae4979cc6627573f774e