diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2020-01-31 11:44:58 -0500 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2020-03-10 23:44:46 +0000 |
| commit | e3d5eaf2bba89db8359393ac7656db19cb421fb5 (patch) | |
| tree | d1b7a7faddd6c4f175cdc0f9150a464da7f91684 /src/test/ui/const-generics/array-impls | |
| parent | f267d9dc191debfef74cc211dbca3d286b51f761 (diff) | |
| download | rust-e3d5eaf2bba89db8359393ac7656db19cb421fb5.tar.gz rust-e3d5eaf2bba89db8359393ac7656db19cb421fb5.zip | |
add ui-tests
Diffstat (limited to 'src/test/ui/const-generics/array-impls')
| -rw-r--r-- | src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/const-generics/array-impls/alloc-types-no-impls-length-33.rs | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs b/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs index db941a440e1..0d0765e971d 100644 --- a/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs +++ b/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs @@ -14,6 +14,10 @@ where Vec::<A>::new() } +pub fn yes_array_into_vec<T>() -> Vec<T> { + [].into() +} + use std::collections::VecDeque; pub fn yes_vecdeque_partial_eq_array<A, B>() -> impl PartialEq<[B; 32]> diff --git a/src/test/ui/const-generics/array-impls/alloc-types-no-impls-length-33.rs b/src/test/ui/const-generics/array-impls/alloc-types-no-impls-length-33.rs index 3a23b9b5832..92dff7e0792 100644 --- a/src/test/ui/const-generics/array-impls/alloc-types-no-impls-length-33.rs +++ b/src/test/ui/const-generics/array-impls/alloc-types-no-impls-length-33.rs @@ -2,6 +2,11 @@ use std::{convert::TryFrom, rc::Rc, sync::Arc}; +pub fn no_vec() { + let v: Vec<_> = [0; 33].into(); + //~^ ERROR the trait bound `std::vec::Vec<u8>: std::convert::From<[u8; 33]>` is not satisfied +} + pub fn no_box() { let boxed_slice = Box::new([0; 33]) as Box<[i32]>; let boxed_array = <Box<[i32; 33]>>::try_from(boxed_slice); |
