Closed de-vri-es closed 7 months ago
The generated code for function bodies produces an unreachable_code warning if the function has a ! return type.
unreachable_code
!
The offending bit is:
if let Some(__ret) == None::<!> { // unreachable }
This PR fixes the warning by simply adding #[allow(unreachable_code)] to the return statement. It also adds a test for it.
#[allow(unreachable_code)]
This problem can only be triggered on nightly with the never_type feature enabled, but it is easy to fix here.
never_type
Published in async-trait 0.1.80.
The generated code for function bodies produces an
unreachable_code
warning if the function has a!
return type.The offending bit is:
This PR fixes the warning by simply adding
#[allow(unreachable_code)]
to the return statement. It also adds a test for it.This problem can only be triggered on nightly with the
never_type
feature enabled, but it is easy to fix here.