Skip to content

Commit 5dcb316

Browse files
committed
vec: add negative-path tests for alloc conversion
1 parent d9b6c56 commit 5dcb316

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/vec/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,6 +2166,9 @@ mod tests {
21662166

21672167
let hv: Vec<u8, 2> = av.clone().try_into().unwrap();
21682168
assert_eq!(hv.as_slice(), av.as_slice());
2169+
2170+
let _: crate::CapacityError =
2171+
<alloc::vec::Vec<u8> as TryInto<Vec<u8, 1>>>::try_into(av.clone()).unwrap_err();
21692172
}
21702173

21712174
fn _test_variance<'a: 'b, 'b>(x: Vec<&'a (), 42>) -> Vec<&'b (), 42> {

0 commit comments

Comments
 (0)