diff options
| author | Mahdi Dibaiee <mdibaiee@pm.me> | 2023-07-11 22:35:29 +0100 |
|---|---|---|
| committer | Mahdi Dibaiee <mdibaiee@pm.me> | 2023-07-14 13:27:35 +0100 |
| commit | fdb2e363d33e04aa306041e2c084e13c6ce489e1 (patch) | |
| tree | cb31ee729e17f74f6a8b3617c60e419937c07ffb /clippy_lints/src/casts | |
| parent | 660ef4ffe8d58ba236555f7c191334b82ce5025f (diff) | |
| download | rust-fdb2e363d33e04aa306041e2c084e13c6ce489e1.tar.gz rust-fdb2e363d33e04aa306041e2c084e13c6ce489e1.zip | |
refactor(rustc_middle): Substs -> GenericArg
Diffstat (limited to 'clippy_lints/src/casts')
| -rw-r--r-- | clippy_lints/src/casts/as_ptr_cast_mut.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/casts/cast_ptr_alignment.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/casts/as_ptr_cast_mut.rs b/clippy_lints/src/casts/as_ptr_cast_mut.rs index 1633ffd589c..fa1550a0ef9 100644 --- a/clippy_lints/src/casts/as_ptr_cast_mut.rs +++ b/clippy_lints/src/casts/as_ptr_cast_mut.rs @@ -17,7 +17,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>, && let ExprKind::MethodCall(method_name, receiver, [], _) = cast_expr.peel_blocks().kind && method_name.ident.name == rustc_span::sym::as_ptr && let Some(as_ptr_did) = cx.typeck_results().type_dependent_def_id(cast_expr.peel_blocks().hir_id) - && let as_ptr_sig = cx.tcx.fn_sig(as_ptr_did).subst_identity() + && let as_ptr_sig = cx.tcx.fn_sig(as_ptr_did).instantiate_identity() && let Some(first_param_ty) = as_ptr_sig.skip_binder().inputs().iter().next() && let ty::Ref(_, _, Mutability::Not) = first_param_ty.kind() && let Some(recv) = snippet_opt(cx, receiver.span) diff --git a/clippy_lints/src/casts/cast_ptr_alignment.rs b/clippy_lints/src/casts/cast_ptr_alignment.rs index 6c8ee296c75..5bf467efa0f 100644 --- a/clippy_lints/src/casts/cast_ptr_alignment.rs +++ b/clippy_lints/src/casts/cast_ptr_alignment.rs @@ -66,7 +66,7 @@ fn is_used_as_unaligned(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { if matches!(name.ident.as_str(), "read_unaligned" | "write_unaligned") && let Some(def_id) = cx.typeck_results().type_dependent_def_id(parent.hir_id) && let Some(def_id) = cx.tcx.impl_of_method(def_id) - && cx.tcx.type_of(def_id).subst_identity().is_unsafe_ptr() + && cx.tcx.type_of(def_id).instantiate_identity().is_unsafe_ptr() { true } else { |
