diff --git a/library/std/src/path/tests.rs b/library/std/src/path/tests.rs index ff94fda5a227b..bf512ac674096 100644 --- a/library/std/src/path/tests.rs +++ b/library/std/src/path/tests.rs @@ -1392,3 +1392,13 @@ fn into_rc() { assert_eq!(&*rc2, path); assert_eq!(&*arc2, path); } + +#[test] +fn prefix_const() { + // test that the methods of `Prefix` are usable in a const context + + const PREFIX: Prefix<'_> = Prefix::Disk(2); + + const IS_VERBATIM: bool = PREFIX.is_verbatim(); + assert!(!IS_VERBATIM); +} diff --git a/src/test/ui/consts/std/path.rs b/src/test/ui/consts/std/path.rs deleted file mode 100644 index af6f99b8c07a3..0000000000000 --- a/src/test/ui/consts/std/path.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass - -use std::path::Prefix; - -fn main() { - const PREFIX : Prefix = Prefix::Disk(2); - - const IS_VERBATIM : bool = PREFIX.is_verbatim(); - assert!(!IS_VERBATIM); -}