Skip to content

Commit 8b8b639

Browse files
committed
Add comment explaining why in these tests unsized locals are not accepted
1 parent 497ee0e commit 8b8b639

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/test/ui/unsized-locals/unsized-local-pat.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#![feature(box_patterns)]
22
#![feature(unsized_fn_params)]
33

4+
// Ensure that even with unsized_fn_params, unsized types in parameter patterns are not accepted.
5+
46
#[allow(dead_code)]
57
fn f1(box box _b: Box<Box<[u8]>>) {}
68
//~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277]

src/test/ui/unsized-locals/unsized-locals-using-unsized-fn-params.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![feature(unsized_fn_params)]
22

3+
// Ensure that even with unsized_fn_params, unsized locals are not accepted.
4+
35
fn main() {
46
let foo: Box<[u8]> = Box::new(*b"foo");
57
let _foo: [u8] = *foo;

0 commit comments

Comments
 (0)