about summary refs log tree commit diff
path: root/library/coretests
diff options
context:
space:
mode:
Diffstat (limited to 'library/coretests')
-rw-r--r--library/coretests/tests/char.rs3
-rw-r--r--library/coretests/tests/lib.rs1
2 files changed, 3 insertions, 1 deletions
diff --git a/library/coretests/tests/char.rs b/library/coretests/tests/char.rs
index 6422387e956..153fb36925e 100644
--- a/library/coretests/tests/char.rs
+++ b/library/coretests/tests/char.rs
@@ -1,3 +1,4 @@
+use std::char::MAX_LEN_UTF8;
 use std::str::FromStr;
 use std::{char, str};
 
@@ -259,7 +260,7 @@ fn test_escape_unicode() {
 #[test]
 fn test_encode_utf8() {
     fn check(input: char, expect: &[u8]) {
-        let mut buf = [0; 4];
+        let mut buf = [0; MAX_LEN_UTF8];
         let ptr = buf.as_ptr();
         let s = input.encode_utf8(&mut buf);
         assert_eq!(s.as_ptr() as usize, ptr as usize);
diff --git a/library/coretests/tests/lib.rs b/library/coretests/tests/lib.rs
index 7fe72862608..adceeb101ff 100644
--- a/library/coretests/tests/lib.rs
+++ b/library/coretests/tests/lib.rs
@@ -13,6 +13,7 @@
 #![feature(bigint_helper_methods)]
 #![feature(bstr)]
 #![feature(cell_update)]
+#![feature(char_max_len)]
 #![feature(clone_to_uninit)]
 #![feature(const_eval_select)]
 #![feature(const_swap_nonoverlapping)]