1 // Regression test for the ICE described in #87046.
4 #![allow(unreachable_patterns)]
6 #[derive(PartialEq, Eq)]
8 pub struct Username(str);
10 pub const ROOT_USER: &Username = Username::from_str("root");
13 pub const fn from_str(raw: &str) -> &Self {
19 unsafe { Transmute { raw }.typed }
22 pub const fn as_str(&self) -> &str {
26 pub fn is_root(&self) -> bool {
29 //~^ ERROR: cannot use unsized non-slice type `Username` in constant patterns