Skip to content

Commit 1bb0872

Browse files
committed
Add a missing test
1 parent 8008ba1 commit 1bb0872

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ run-crash
2+
//@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes
3+
//@ error-pattern: as_ascii_unchecked requires that the
4+
//@ revisions: char str
5+
6+
#![feature(ascii_char)]
7+
8+
use std::ascii::Char;
9+
10+
fn main() {
11+
unsafe {
12+
#[cfg(char)]
13+
let _c: Char = '🦀'.as_ascii_unchecked();
14+
#[cfg(str)]
15+
let _c: &[Char] = "🦀".as_ascii_unchecked();
16+
}
17+
}

0 commit comments

Comments
 (0)