-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
return unfixed len if pat has reported error
- Loading branch information
Showing
3 changed files
with
47 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,12 @@ | ||
#![allow(incomplete_features)] | ||
#![feature(generic_const_exprs)] | ||
|
||
fn something(path: [usize; N]) -> impl Clone { | ||
//~^ ERROR cannot find value `N` in this scope | ||
match path { | ||
[] => 0, //~ ERROR cannot pattern-match on an array without a fixed length | ||
_ => 1, | ||
}; | ||
} | ||
|
||
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,21 @@ | ||
error[E0425]: cannot find value `N` in this scope | ||
--> $DIR/issue-116186.rs:4:28 | ||
| | ||
LL | fn something(path: [usize; N]) -> impl Clone { | ||
| ^ not found in this scope | ||
| | ||
help: you might be missing a const parameter | ||
| | ||
LL | fn something<const N: /* Type */>(path: [usize; N]) -> impl Clone { | ||
| +++++++++++++++++++++ | ||
|
||
error[E0730]: cannot pattern-match on an array without a fixed length | ||
--> $DIR/issue-116186.rs:7:9 | ||
| | ||
LL | [] => 0, | ||
| ^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0425, E0730. | ||
For more information about an error, try `rustc --explain E0425`. |