Skip to content

Commit e3d5eaf

Browse files
committed
add ui-tests
1 parent f267d9d commit e3d5eaf

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ where
1414
Vec::<A>::new()
1515
}
1616

17+
pub fn yes_array_into_vec<T>() -> Vec<T> {
18+
[].into()
19+
}
20+
1721
use std::collections::VecDeque;
1822

1923
pub fn yes_vecdeque_partial_eq_array<A, B>() -> impl PartialEq<[B; 32]>

src/test/ui/const-generics/array-impls/alloc-types-no-impls-length-33.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
use std::{convert::TryFrom, rc::Rc, sync::Arc};
44

5+
pub fn no_vec() {
6+
let v: Vec<_> = [0; 33].into();
7+
//~^ ERROR the trait bound `std::vec::Vec<u8>: std::convert::From<[u8; 33]>` is not satisfied
8+
}
9+
510
pub fn no_box() {
611
let boxed_slice = Box::new([0; 33]) as Box<[i32]>;
712
let boxed_array = <Box<[i32; 33]>>::try_from(boxed_slice);

0 commit comments

Comments
 (0)