summary refs log tree commit diff
path: root/library/alloc/tests/lib.rs
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2021-11-05 15:39:01 +0300
committerMaybe Waffle <waffle.lapkin@gmail.com>2021-11-18 00:50:42 +0300
commitcf6f64a963f3cf630ca4bc3688cf461a98d2c9ce (patch)
tree4cae355fdc2398feb66f1195a72a293ddca13343 /library/alloc/tests/lib.rs
parentc9c4b5d7276297679387189d96a952f2b760e7ad (diff)
downloadrust-cf6f64a963f3cf630ca4bc3688cf461a98d2c9ce.tar.gz
rust-cf6f64a963f3cf630ca4bc3688cf461a98d2c9ce.zip
Make slice->str conversion and related functions const
This commit makes the following functions from `core::str` `const fn`:
- `from_utf8[_mut]` (`feature(const_str_from_utf8)`)
- `from_utf8_unchecked_mut` (`feature(const_str_from_utf8_unchecked_mut)`)
- `Utf8Error::{valid_up_to,error_len}` (`feature(const_str_from_utf8)`)
Diffstat (limited to 'library/alloc/tests/lib.rs')
-rw-r--r--library/alloc/tests/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs
index 8c57c804ad2..68e48348b07 100644
--- a/library/alloc/tests/lib.rs
+++ b/library/alloc/tests/lib.rs
@@ -25,6 +25,7 @@
 #![feature(const_btree_new)]
 #![feature(const_default_impls)]
 #![feature(const_trait_impl)]
+#![feature(const_str_from_utf8)]
 
 use std::collections::hash_map::DefaultHasher;
 use std::hash::{Hash, Hasher};