We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63b1db0 commit 55bda11Copy full SHA for 55bda11
compiler/rustc_lint/src/unused.rs
@@ -291,11 +291,9 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
291
let parent_mod_did = cx.tcx.parent_module(expr.hir_id).to_def_id();
292
let is_uninhabited =
293
|t: Ty<'tcx>| !t.is_inhabited_from(cx.tcx, parent_mod_did, cx.typing_env());
294
- if is_uninhabited(ty) {
295
- return Some(MustUsePath::Suppressed);
296
- }
297
298
match *ty.kind() {
+ _ if is_uninhabited(ty) => Some(MustUsePath::Suppressed),
299
ty::Adt(..) if let Some(boxed) = ty.boxed_ty() => {
300
is_ty_must_use(cx, boxed, expr, span)
301
.map(|inner| MustUsePath::Boxed(Box::new(inner)))
0 commit comments