Skip to content

Commit a5574ea

Browse files
committed
Auto merge of rust-lang#116930 - RalfJung:raw-ptr-match, r=davidtwco
patterns: reject raw pointers that are not just integers Matching against `0 as *const i32` is fine, matching against `&42 as *const i32` is not. This extends the existing check against function pointers and wide pointers: we now uniformly reject all these pointer types during valtree construction, and then later lint because of that. See [here](rust-lang#116930 (comment)) for some more explanation and context. Also fixes rust-lang#116929. Cc `@oli-obk` `@lcnr`
2 parents d1d8fba + 7eeb061 commit a5574ea

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/marker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ marker_impls! {
253253
///
254254
/// const CFN: Wrap<fn(&())> = Wrap(higher_order);
255255
///
256+
/// #[allow(pointer_structural_match)]
256257
/// fn main() {
257258
/// match CFN {
258259
/// CFN => {}

0 commit comments

Comments
 (0)