Remove dependency on slice_internals feature in rustc_ast
This commit is contained in:
parent
e6485ed22a
commit
f72e17f8fb
4 changed files with 3 additions and 2 deletions
|
@ -3633,6 +3633,7 @@ name = "rustc_ast"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
"memchr",
|
||||||
"rustc_data_structures",
|
"rustc_data_structures",
|
||||||
"rustc_index",
|
"rustc_index",
|
||||||
"rustc_lexer",
|
"rustc_lexer",
|
||||||
|
|
|
@ -7,6 +7,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "1.2.1"
|
bitflags = "1.2.1"
|
||||||
|
memchr = "2.5.0"
|
||||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||||
rustc_index = { path = "../rustc_index" }
|
rustc_index = { path = "../rustc_index" }
|
||||||
rustc_lexer = { path = "../rustc_lexer" }
|
rustc_lexer = { path = "../rustc_lexer" }
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(min_specialization)]
|
#![feature(min_specialization)]
|
||||||
#![feature(negative_impls)]
|
#![feature(negative_impls)]
|
||||||
#![feature(slice_internals)]
|
|
||||||
#![feature(stmt_expr_attributes)]
|
#![feature(stmt_expr_attributes)]
|
||||||
#![recursion_limit = "256"]
|
#![recursion_limit = "256"]
|
||||||
#![deny(rustc::untranslatable_diagnostic)]
|
#![deny(rustc::untranslatable_diagnostic)]
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub fn contains_text_flow_control_chars(s: &str) -> bool {
|
||||||
// U+2069 - E2 81 A9
|
// U+2069 - E2 81 A9
|
||||||
let mut bytes = s.as_bytes();
|
let mut bytes = s.as_bytes();
|
||||||
loop {
|
loop {
|
||||||
match core::slice::memchr::memchr(0xE2, bytes) {
|
match memchr::memchr(0xE2, bytes) {
|
||||||
Some(idx) => {
|
Some(idx) => {
|
||||||
// bytes are valid UTF-8 -> E2 must be followed by two bytes
|
// bytes are valid UTF-8 -> E2 must be followed by two bytes
|
||||||
let ch = &bytes[idx..idx + 3];
|
let ch = &bytes[idx..idx + 3];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue