Skip to content

Commit f72e17f

Browse files
Remove dependency on slice_internals feature in rustc_ast
1 parent e6485ed commit f72e17f

File tree

4 files changed

+3
-2
lines changed

4 files changed

+3
-2
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -3633,6 +3633,7 @@ name = "rustc_ast"
36333633
version = "0.0.0"
36343634
dependencies = [
36353635
"bitflags",
3636+
"memchr",
36363637
"rustc_data_structures",
36373638
"rustc_index",
36383639
"rustc_lexer",

compiler/rustc_ast/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2021"
77

88
[dependencies]
99
bitflags = "1.2.1"
10+
memchr = "2.5.0"
1011
rustc_data_structures = { path = "../rustc_data_structures" }
1112
rustc_index = { path = "../rustc_index" }
1213
rustc_lexer = { path = "../rustc_lexer" }

compiler/rustc_ast/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![feature(let_chains)]
1717
#![feature(min_specialization)]
1818
#![feature(negative_impls)]
19-
#![feature(slice_internals)]
2019
#![feature(stmt_expr_attributes)]
2120
#![recursion_limit = "256"]
2221
#![deny(rustc::untranslatable_diagnostic)]

compiler/rustc_ast/src/util/unicode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn contains_text_flow_control_chars(s: &str) -> bool {
1717
// U+2069 - E2 81 A9
1818
let mut bytes = s.as_bytes();
1919
loop {
20-
match core::slice::memchr::memchr(0xE2, bytes) {
20+
match memchr::memchr(0xE2, bytes) {
2121
Some(idx) => {
2222
// bytes are valid UTF-8 -> E2 must be followed by two bytes
2323
let ch = &bytes[idx..idx + 3];

0 commit comments

Comments
 (0)