diff options
| author | Michael Goulet <michael@errs.io> | 2024-03-21 17:07:52 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-03-22 11:13:27 -0400 |
| commit | f0f224a37f117104358f4d807d71037256f5a646 (patch) | |
| tree | a1d46519e0d79521e4ed3a62c73f9a27e10700be /compiler/rustc_lint | |
| parent | 81e7e809904a84c493b51ba4d1109513a929f246 (diff) | |
| download | rust-f0f224a37f117104358f4d807d71037256f5a646.tar.gz rust-f0f224a37f117104358f4d807d71037256f5a646.zip | |
Ty::new_ref and Ty::new_ptr stop using TypeAndMut
Diffstat (limited to 'compiler/rustc_lint')
| -rw-r--r-- | compiler/rustc_lint/src/types.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index 0ad257d02bd..f8c1f478833 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -1046,10 +1046,10 @@ fn get_nullable_type<'tcx>( } ty::Int(ty) => Ty::new_int(tcx, ty), ty::Uint(ty) => Ty::new_uint(tcx, ty), - ty::RawPtr(ty_mut) => Ty::new_ptr(tcx, ty_mut), + ty::RawPtr(ty_mut) => Ty::new_ptr(tcx, ty_mut.ty, ty_mut.mutbl), // As these types are always non-null, the nullable equivalent of // `Option<T>` of these types are their raw pointer counterparts. - ty::Ref(_region, ty, mutbl) => Ty::new_ptr(tcx, ty::TypeAndMut { ty, mutbl }), + ty::Ref(_region, ty, mutbl) => Ty::new_ptr(tcx, ty, mutbl), // There is no nullable equivalent for Rust's function pointers, // you must use an `Option<fn(..) -> _>` to represent it. ty::FnPtr(..) => ty, |
