Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not use unsized_fn_params in patterns
- Loading branch information
1 parent
58018d4
commit ca41681
Showing
4 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![feature(box_patterns)] | ||
#![feature(unsized_fn_params)] | ||
|
||
#[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] | ||
|
||
fn f2((_x, _y): (i32, [i32])) {} | ||
//~^ ERROR: the size for values of type `[i32]` cannot be known at compilation time [E0277] | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time | ||
--> $DIR/unsized-local-pat.rs:5:15 | ||
| | ||
LL | fn f1(box box _b: Box<Box<[u8]>>) {} | ||
| ^^ doesn't have a size known at compile-time | ||
| | ||
= help: the trait `Sized` is not implemented for `[u8]` | ||
= note: all local variables must have a statically known size | ||
= help: unsized locals are gated as an unstable feature | ||
|
||
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time | ||
--> $DIR/unsized-local-pat.rs:8:12 | ||
| | ||
LL | fn f2((_x, _y): (i32, [i32])) {} | ||
| ^^ doesn't have a size known at compile-time | ||
| | ||
= help: the trait `Sized` is not implemented for `[i32]` | ||
= note: all local variables must have a statically known size | ||
= help: unsized locals are gated as an unstable feature | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters