]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_lint/src/unused.rs
Rollup merge of #104775 - spastorino:use-obligation-ctxt-normalize, r=lcnr
[rust.git] / compiler / rustc_lint / src / unused.rs
index 5c4c46f84d7178426f93e78f57dcdfebd52ecfd4..0471890230aa6a4d6256ce9a570ea4caeb4f4598 100644 (file)
@@ -235,9 +235,9 @@ fn is_ty_must_use<'tcx>(
             span: Span,
         ) -> Option<MustUsePath> {
             if ty.is_unit()
-                || cx.tcx.is_ty_uninhabited_from(
+                || !ty.is_inhabited_from(
+                    cx.tcx,
                     cx.tcx.parent_module(expr.hir_id).to_def_id(),
-                    ty,
                     cx.param_env,
                 )
             {