2020-03-02 10:53:58 -08:00
|
|
|
// Regression test for #69615.
|
|
|
|
|
2021-04-25 18:42:53 +02:00
|
|
|
#![feature(const_trait_impl)]
|
2020-03-02 10:53:58 -08:00
|
|
|
|
2022-08-28 06:27:31 +00:00
|
|
|
#[const_trait]
|
2020-03-02 10:53:58 -08:00
|
|
|
pub trait MyTrait {
|
2020-06-25 17:43:48 -07:00
|
|
|
fn method(&self) -> Option<()>;
|
2020-03-02 10:53:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
impl const MyTrait for () {
|
2020-06-25 17:43:48 -07:00
|
|
|
fn method(&self) -> Option<()> {
|
|
|
|
Some(())?; //~ ERROR `?` is not allowed in a `const fn`
|
|
|
|
None
|
2020-03-02 10:53:58 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|