File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,21 @@ LL | let _: u8 = *p;
1515 = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
1616
1717error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
18- --> $DIR/unsafe-fn-deref-ptr.rs:7:12
18+ --> $DIR/unsafe-fn-deref-ptr.rs:7:9
19+ |
20+ LL | _ = *p;
21+ | ^^ dereference of raw pointer
22+ |
23+ = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
24+
25+ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
26+ --> $DIR/unsafe-fn-deref-ptr.rs:8:12
1927 |
2028LL | return *p;
2129 | ^^ dereference of raw pointer
2230 |
2331 = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
2432
25- error: aborting due to 3 previous errors
33+ error: aborting due to 4 previous errors
2634
2735For more information about this error, try `rustc --explain E0133`.
Original file line number Diff line number Diff line change 44fn f ( p : * const u8 ) -> u8 {
55 let _ = * p; //~ ERROR dereference of raw pointer is unsafe
66 let _: u8 = * p; //~ ERROR dereference of raw pointer is unsafe
7+ _ = * p; //~ ERROR dereference of raw pointer is unsafe
78 return * p; //~ ERROR dereference of raw pointer is unsafe
89}
910
Original file line number Diff line number Diff line change @@ -15,13 +15,21 @@ LL | let _: u8 = *p;
1515 = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
1616
1717error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
18- --> $DIR/unsafe-fn-deref-ptr.rs:7:12
18+ --> $DIR/unsafe-fn-deref-ptr.rs:7:9
19+ |
20+ LL | _ = *p;
21+ | ^^ dereference of raw pointer
22+ |
23+ = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
24+
25+ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
26+ --> $DIR/unsafe-fn-deref-ptr.rs:8:12
1927 |
2028LL | return *p;
2129 | ^^ dereference of raw pointer
2230 |
2331 = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
2432
25- error: aborting due to 3 previous errors
33+ error: aborting due to 4 previous errors
2634
2735For more information about this error, try `rustc --explain E0133`.
You can’t perform that action at this time.
0 commit comments