@@ -123,7 +123,7 @@ 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) ,
@@ -132,11 +132,12 @@ fn check_rvalue<'tcx>(
132132PointerCoercion :: UnsafeFnPointer
133133 | PointerCoercion :: ClosureFnPointer ( _)
134134 | PointerCoercion :: ReifyFnPointer ,
135+ _,
135136) ,
136137 _,
137138 _,
138139) => Err ( ( span, "function pointer casts are not allowed in const fn" . into ( ) ) ) ,
139- Rvalue :: Cast ( CastKind :: PointerCoercion ( PointerCoercion :: Unsize ) , op, cast_ty) => {
140+ Rvalue :: Cast ( CastKind :: PointerCoercion ( PointerCoercion :: Unsize , _ ) , op, cast_ty) => {
140141let Some ( pointee_ty) = cast_ty. builtin_deref ( true ) else {
141142// We cannot allow this for now.
142143return Err ( ( span, "unsizing casts are only allowed for references right now" . into ( ) ) ) ;
@@ -154,7 +155,7 @@ fn check_rvalue<'tcx>(
154155Rvalue :: Cast ( CastKind :: PointerExposeProvenance , _, _) => {
155156Err ( ( span, "casting pointers to ints is unstable in const fn" . into ( ) ) )
156157} ,
157- Rvalue :: Cast ( CastKind :: DynStar , _, _) => {
158+ Rvalue :: Cast ( CastKind :: PointerCoercion ( PointerCoercion :: DynStar , _ ) , _, _) => {
158159// FIXME(dyn-star)
159160unimplemented ! ( )
160161} ,
0 commit comments