Skip to content

Commit 08a8e68

Browse files
author
Lukas Markeffsky
committed
be even more precise about "cast" vs "coercion"
1 parent d802a7a commit 08a8e68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,20 @@ fn check_rvalue<'tcx>(
123123
| CastKind::FloatToFloat
124124
| CastKind::FnPtrToPtr
125125
| CastKind::PtrToPtr
126-
| CastKind::PointerCoercion(PointerCoercion::MutToConstPointer | PointerCoercion::ArrayToPointer),
126+
| CastKind::PointerCoercion(PointerCoercion::MutToConstPointer | PointerCoercion::ArrayToPointer, _),
127127
operand,
128128
_,
129129
) => check_operand(tcx, operand, span, body, msrv),
130130
Rvalue::Cast(
131131
CastKind::PointerCoercion(
132132
PointerCoercion::UnsafeFnPointer
133133
| PointerCoercion::ClosureFnPointer(_)
134-
| PointerCoercion::ReifyFnPointer,
134+
| PointerCoercion::ReifyFnPointer, _
135135
),
136136
_,
137137
_,
138138
) => Err((span, "function pointer casts are not allowed in const fn".into())),
139-
Rvalue::Cast(CastKind::PointerCoercion(PointerCoercion::Unsize), op, cast_ty) => {
139+
Rvalue::Cast(CastKind::PointerCoercion(PointerCoercion::Unsize, _), op, cast_ty) => {
140140
let Some(pointee_ty) = cast_ty.builtin_deref(true) else {
141141
// We cannot allow this for now.
142142
return Err((span, "unsizing casts are only allowed for references right now".into()));
@@ -154,7 +154,7 @@ fn check_rvalue<'tcx>(
154154
Rvalue::Cast(CastKind::PointerExposeProvenance, _, _) => {
155155
Err((span, "casting pointers to ints is unstable in const fn".into()))
156156
},
157-
Rvalue::Cast(CastKind::PointerCoercion(PointerCoercion::DynStar), _, _) => {
157+
Rvalue::Cast(CastKind::PointerCoercion(PointerCoercion::DynStar, _), _, _) => {
158158
// FIXME(dyn-star)
159159
unimplemented!()
160160
},

0 commit comments

Comments
 (0)