Move various ui const tests to library
Move: - `src\test\ui\consts\const-nonzero.rs` to `library\core` - `src\test\ui\consts\ascii.rs` to `library\core` - `src\test\ui\consts\cow-is-borrowed` to `library\alloc` Part of #76268
This commit is contained in:
parent
0d0f6b1130
commit
538e198193
7 changed files with 42 additions and 46 deletions
|
@ -45,3 +45,16 @@ fn test_from_cow_path() {
|
|||
let path = Path::new("hello");
|
||||
test_from_cow!(path: &Path);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cow_const() {
|
||||
// test that the methods of `Cow` are usable in a const context
|
||||
|
||||
const COW: Cow<'_, str> = Cow::Borrowed("moo");
|
||||
|
||||
const IS_BORROWED: bool = COW.is_borrowed();
|
||||
assert!(IS_BORROWED);
|
||||
|
||||
const IS_OWNED: bool = COW.is_owned();
|
||||
assert!(!IS_OWNED);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#![feature(allocator_api)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(cow_is_borrowed)]
|
||||
#![feature(drain_filter)]
|
||||
#![feature(exact_size_is_empty)]
|
||||
#![feature(new_uninit)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue