Silence [question_mark] in const context

This commit is contained in:
kraktus 2022-09-16 22:02:09 +02:00
parent 481dc2e81c
commit 3ca6b9d031
3 changed files with 24 additions and 4 deletions

View file

@ -223,3 +223,12 @@ fn pattern() -> Result<(), PatternedError> {
}
fn main() {}
// should not lint, `?` operator not available in const context
const fn issue9175(option: Option<()>) -> Option<()> {
if option.is_none() {
return None;
}
//stuff
Some(())
}

View file

@ -259,3 +259,12 @@ fn pattern() -> Result<(), PatternedError> {
}
fn main() {}
// should not lint, `?` operator not available in const context
const fn issue9175(option: Option<()>) -> Option<()> {
if option.is_none() {
return None;
}
//stuff
Some(())
}