diff options
| author | Michael Goulet <michael@errs.io> | 2022-11-26 21:32:01 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-12-13 17:40:27 +0000 |
| commit | c13bd83528da223fa073e9c7e5fdc435254baab6 (patch) | |
| tree | 0aead1dc9f39a3a4ba168119964c3a7e3728cc7b /compiler/rustc_lint | |
| parent | 5c6afb850c29f5604f685bf4d4fea85a2deb7197 (diff) | |
| download | rust-c13bd83528da223fa073e9c7e5fdc435254baab6.tar.gz rust-c13bd83528da223fa073e9c7e5fdc435254baab6.zip | |
squash OpaqueTy and ProjectionTy into AliasTy
Diffstat (limited to 'compiler/rustc_lint')
| -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 f745e8201a8..6cd806354bb 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(ty::OpaqueTy { def_id, substs: _ }), + ty::Opaque(ty::AliasTy { 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 14882be3e01..6851f6f9d6b 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(ty::OpaqueTy { def_id: future_def_id, substs: _ }) = ty.kind() + && let ty::Opaque(ty::AliasTy { 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(ty::OpaqueTy { def_id: def, substs: _ }) => { + ty::Opaque(ty::AliasTy { def_id: def, substs: _ }) => { elaborate_predicates_with_span( cx.tcx, cx.tcx.explicit_item_bounds(def).iter().cloned(), |
