Rollup merge of #129332 - cuviper:cstr-cast, r=compiler-errors · patricklam/verify-rust-std@d37ebfe (original) (raw)

Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
116 116 if pfd.revents & libc::POLLNVAL == 0 {
117 117 continue;
118 118 }
119 -if open64(c"/dev/null".as_ptr().cast(), libc::O_RDWR, 0) == -1 {
119 +if open64(c"/dev/null".as_ptr(), libc::O_RDWR, 0) == -1 {
120 120 // If the stream is closed but we failed to reopen it, abort the
121 121 // process. Otherwise we wouldn't preserve the safety of
122 122 // operations on the corresponding Rust object Stdin, Stdout, or
@@ -147,7 +147,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
147 147 use crate::sys::os::errno;
148 148 for fd in 0..3 {
149 149 if libc::fcntl(fd, libc::F_GETFD) == -1 && errno() == libc::EBADF {
150 -if open64(c"/dev/null".as_ptr().cast(), libc::O_RDWR, 0) == -1 {
150 +if open64(c"/dev/null".as_ptr(), libc::O_RDWR, 0) == -1 {
151 151 // If the stream is closed but we failed to reopen it, abort the
152 152 // process. Otherwise we wouldn't preserve the safety of
153 153 // operations on the corresponding Rust object Stdin, Stdout, or