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 c9537a9 commit 622197bCopy full SHA for 622197b
compiler/rustc_lint/src/unused.rs
@@ -279,11 +279,9 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
279
let parent_mod_did = cx.tcx.parent_module(expr.hir_id).to_def_id();
280
let is_uninhabited =
281
|t: Ty<'tcx>| !t.is_inhabited_from(cx.tcx, parent_mod_did, cx.typing_env());
282
- if is_uninhabited(ty) {
283
- return Some(MustUsePath::Suppressed);
284
- }
285
286
match *ty.kind() {
+ _ if is_uninhabited(ty) => Some(MustUsePath::Suppressed),
287
ty::Adt(..) if let Some(boxed) = ty.boxed_ty() => {
288
is_ty_must_use(cx, boxed, expr, span)
289
.map(|inner| MustUsePath::Boxed(Box::new(inner)))
0 commit comments