False-positive on an empty function, probably because of the return type
Closed this issue · 1 comments
orsinium commented
#[no_panic]
fn parse_color(c: i32) -> Option<Gray4> {
None
}
ERROR[no-panic]: detected panic in function `parse_color`
'
collect2: error: ld returned 1 exit status
Where Gray4
is from embedded-graphics: https://docs.rs/embedded-graphics/0.8.1/embedded_graphics/pixelcolor/struct.Gray4.html
dtolnay commented
You'll need to apply the suggestions under https://github.com/dtolnay/no-panic#caveats (opt-level, lto, codegen-units).