Skip to content

Commit 38f3ad4

Browse files
authored
Squash closure cast error into fn ptr cast error
1 parent 007390c commit 38f3ad4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/librustc_mir/transform/qualify_min_const_fn.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,11 @@ fn check_rvalue(
164164
}
165165
}
166166
Rvalue::Cast(CastKind::UnsafeFnPointer, _, _) |
167+
Rvalue::Cast(CastKind::ClosureFnPointer, _, _) |
167168
Rvalue::Cast(CastKind::ReifyFnPointer, _, _) => Err((
168169
span,
169170
"function pointer casts are not allowed in const fn".into(),
170171
)),
171-
Rvalue::Cast(CastKind::ClosureFnPointer, _, _) => Err((
172-
span,
173-
"closures are not allowed in const fn".into(),
174-
)),
175172
Rvalue::Cast(CastKind::Unsize, _, _) => Err((
176173
span,
177174
"unsizing casts are not allowed in const fn".into(),

0 commit comments

Comments
 (0)