Silence [question_mark] in const context
This commit is contained in:
parent
481dc2e81c
commit
3ca6b9d031
3 changed files with 24 additions and 4 deletions
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue