File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed
tests/ui/precondition-checks Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change 11//@ run-fail
22//@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes
33//@ error-pattern: unsafe precondition(s) violated: ptr::read_volatile requires
4- //@ revisions: null misaligned
4+ //@ revisions: misaligned
55
66#![ allow( invalid_null_arguments) ]
77
@@ -11,8 +11,6 @@ fn main() {
1111 let src = [ 0u16 ; 2 ] ;
1212 let src = src. as_ptr ( ) ;
1313 unsafe {
14- #[ cfg( null) ]
15- ptr:: read_volatile ( ptr:: null :: < u8 > ( ) ) ;
1614 #[ cfg( misaligned) ]
1715 ptr:: read_volatile ( src. byte_add ( 1 ) ) ;
1816 }
Original file line number Diff line number Diff line change 11//@ run-fail
22//@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes
33//@ error-pattern: unsafe precondition(s) violated: ptr::write_volatile requires
4- //@ revisions: null misaligned
5-
6- #![ allow( invalid_null_arguments) ]
4+ //@ revisions: misaligned
75
86use std:: ptr;
97
108fn main ( ) {
119 let mut dst = [ 0u16 ; 2 ] ;
1210 let mut dst = dst. as_mut_ptr ( ) ;
1311 unsafe {
14- #[ cfg( null) ]
15- ptr:: write_volatile ( ptr:: null_mut :: < u8 > ( ) , 1u8 ) ;
1612 #[ cfg( misaligned) ]
1713 ptr:: write_volatile ( dst. byte_add ( 1 ) , 1u16 ) ;
1814 }
You can’t perform that action at this time.
0 commit comments