diff options
| author | Michael Goulet <michael@errs.io> | 2024-03-21 17:33:10 -0400 | 
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-03-22 11:13:29 -0400 | 
| commit | 7be0dbe77292de955da02fe1de1626bdd2e4cc0a (patch) | |
| tree | be790699979e783668fcaca21d48c6982983b13e /compiler/rustc_lint/src/reference_casting.rs | |
| parent | ff0c31e6b9bc8e847c3b1b9d61793325edfacf47 (diff) | |
| download | rust-7be0dbe77292de955da02fe1de1626bdd2e4cc0a.tar.gz rust-7be0dbe77292de955da02fe1de1626bdd2e4cc0a.zip | |
Make RawPtr take Ty and Mutbl separately
Diffstat (limited to 'compiler/rustc_lint/src/reference_casting.rs')
| -rw-r--r-- | compiler/rustc_lint/src/reference_casting.rs | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/compiler/rustc_lint/src/reference_casting.rs b/compiler/rustc_lint/src/reference_casting.rs index 41aa4019bb7..9b938b34c00 100644 --- a/compiler/rustc_lint/src/reference_casting.rs +++ b/compiler/rustc_lint/src/reference_casting.rs @@ -1,7 +1,7 @@ use rustc_ast::Mutability; use rustc_hir::{Expr, ExprKind, UnOp}; use rustc_middle::ty::layout::LayoutOf as _; -use rustc_middle::ty::{self, layout::TyAndLayout, TypeAndMut}; +use rustc_middle::ty::{self, layout::TyAndLayout}; use rustc_span::sym; use crate::{lints::InvalidReferenceCastingDiag, LateContext, LateLintPass, LintContext}; @@ -153,7 +153,7 @@ fn is_cast_from_ref_to_mut_ptr<'tcx>( let end_ty = cx.typeck_results().node_type(orig_expr.hir_id); // Bail out early if the end type is **not** a mutable pointer. - if !matches!(end_ty.kind(), ty::RawPtr(TypeAndMut { ty: _, mutbl: Mutability::Mut })) { + if !matches!(end_ty.kind(), ty::RawPtr(_, Mutability::Mut)) { return None; } | 
