diff options
| author | Michael Goulet <michael@errs.io> | 2022-11-26 21:09:39 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-12-13 17:29:26 +0000 |
| commit | 7f3af726065d9eaabf93d87f22d97f60cca7a5f1 (patch) | |
| tree | d3501a3fc742f5e786697c99c7e230a497551e1a /compiler/rustc_lint/src | |
| parent | 918ede64740b3610dfd8b43ff0d995261a236ac5 (diff) | |
| download | rust-7f3af726065d9eaabf93d87f22d97f60cca7a5f1.tar.gz rust-7f3af726065d9eaabf93d87f22d97f60cca7a5f1.zip | |
Use ty::OpaqueTy everywhere
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/unused.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs b/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs index 03d6f4fd926..863c19bd3d6 100644 --- a/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs +++ b/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs @@ -117,7 +117,7 @@ impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound { // then we can emit a suggestion to add the bound. let add_bound = match (proj_term.kind(), assoc_pred.kind().skip_binder()) { ( - ty::Opaque(def_id, _), + ty::Opaque(ty::OpaqueTy { def_id, substs: _ }), ty::PredicateKind::Clause(ty::Clause::Trait(trait_pred)), ) => Some(AddBound { suggest_span: cx.tcx.def_span(*def_id).shrink_to_hi(), diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index dc352778f1d..14882be3e01 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -96,7 +96,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { if let hir::ExprKind::Match(await_expr, _arms, hir::MatchSource::AwaitDesugar) = expr.kind && let ty = cx.typeck_results().expr_ty(&await_expr) - && let ty::Opaque(future_def_id, _) = ty.kind() + && let ty::Opaque(ty::OpaqueTy { def_id: future_def_id, substs: _ }) = ty.kind() && cx.tcx.ty_is_opaque_future(ty) // FIXME: This also includes non-async fns that return `impl Future`. && let async_fn_def_id = cx.tcx.parent(*future_def_id) @@ -251,7 +251,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { .map(|inner| MustUsePath::Boxed(Box::new(inner))) } ty::Adt(def, _) => is_def_must_use(cx, def.did(), span), - ty::Opaque(def, _) => { + ty::Opaque(ty::OpaqueTy { def_id: def, substs: _ }) => { elaborate_predicates_with_span( cx.tcx, cx.tcx.explicit_item_bounds(def).iter().cloned(), |
