Commit fce74ba
authored
Rollup merge of rust-lang#144573 - BoxyUwU:patkind_constant_ptr_docs, r=lcnr
Raw Pointers are Constant PatKinds too
raw pointers can be matched on with a const pattern:
```rust
const FOO: *const u8 = core::ptr::null();
fn foo(a: *const u8) {
match a {
FOO => (),
_ => todo!(),
}
}
```
as far as I can tell this is represented with a `PatKind::Constant`: https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs#L333-L3371 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
| 841 | + | |
| 842 | + | |
841 | 843 | | |
842 | 844 | | |
843 | 845 | | |
| |||
0 commit comments