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