-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix gce ICE when encountering ill-formed consts
- Loading branch information
Showing
3 changed files
with
29 additions
and
4 deletions.
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,10 @@ | ||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
struct Checked<const F: fn()>; | ||
//~^ERROR: using function pointers as const generic parameters is forbidden | ||
|
||
fn foo() {} | ||
const _: Checked<foo> = Checked::<foo>; | ||
|
||
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,10 @@ | ||
error: using function pointers as const generic parameters is forbidden | ||
--> $DIR/issue-118545.rs:4:25 | ||
| | ||
LL | struct Checked<const F: fn()>; | ||
| ^^^^ | ||
| | ||
= note: the only supported types are integers, `bool` and `char` | ||
|
||
error: aborting due to 1 previous error | ||
|