-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
#![feature(min_const_fn)]
use std::marker::PhantomData;
pub struct Foo<T>(PhantomData<T>);
pub trait Bar {}
impl<T: Bar> Foo<T> {
pub const fn foo() -> Self {
Foo(PhantomData)
}
}
fn main() {}
Errors:
Compiling playground v0.0.1 (/playground)
error: trait bounds other than `Sized` on const fn parameters are unstable
--> src/main.rs:5:6
|
5 | impl<T: Bar> Foo<T> {
| ^
error: aborting due to previous error
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
The error should mention which feature has to be enabled to make use of this. The feature is const_fn
.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.