Skip to content

Commit

Permalink
Add comment explaining why in these tests unsized locals are not acce…
Browse files Browse the repository at this point in the history
…pted
  • Loading branch information
spastorino committed Oct 27, 2020
1 parent 497ee0e commit 8b8b639
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/ui/unsized-locals/unsized-local-pat.rs
@@ -1,6 +1,8 @@
#![feature(box_patterns)]
#![feature(unsized_fn_params)]

// Ensure that even with unsized_fn_params, unsized types in parameter patterns are not accepted.

#[allow(dead_code)]
fn f1(box box _b: Box<Box<[u8]>>) {}
//~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277]
Expand Down
@@ -1,5 +1,7 @@
#![feature(unsized_fn_params)]

// Ensure that even with unsized_fn_params, unsized locals are not accepted.

fn main() {
let foo: Box<[u8]> = Box::new(*b"foo");
let _foo: [u8] = *foo;
Expand Down

0 comments on commit 8b8b639

Please sign in to comment.