Auto merge of #9487 - kraktus:question_mark, r=Jarcho
Silence [`question_mark`] in const context fix https://github.com/rust-lang/rust-clippy/issues/9175 When `const_try` is stabilised can be turned into a MSRV changelog: Silence [`question_mark`] in const context
This commit is contained in:
commit
78dc616a7a
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