File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ // check-pass
2+
3+ // This is issue #85435. But the real story is reflected in issue #85561, where
4+ // a bug in the implementation of feature(capture_disjoint_fields) () was
5+ // exposed to non-feature-gated code by a diagnostic changing PR that removed
6+ // the gating in one case.
7+
8+ // This test is double-checking that the case of interest continues to work as
9+ // expected in the *absence* of that feature gate. At the time of this writing,
10+ // enabling the feature gate will cause this test to fail. We obviously cannot
11+ // stabilize that feature until it can correctly handle this test.
12+
13+ fn main ( ) {
14+ let val: u8 = 5 ;
15+ let u8_ptr: * const u8 = & val;
16+ let _closure = || {
17+ unsafe {
18+ // Fails compilation with:
19+ // error[E0133]: dereference of raw pointer is unsafe and
20+ // requires unsafe function or block
21+ let tmp = * u8_ptr;
22+ tmp
23+
24+ // Just dereferencing and returning directly compiles fine:
25+ // *u8_ptr
26+ }
27+ } ;
28+ }
You can’t perform that action at this time.
0 commit comments