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

Original file line numberDiff line numberDiff line change

@@ -116,7 +116,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {

116116

if pfd.revents & libc::POLLNVAL == 0 {

117117

continue;

118118

}

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 {

120120

// If the stream is closed but we failed to reopen it, abort the

121121

// process. Otherwise we wouldn't preserve the safety of

122122

// 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) {

147147

use crate::sys::os::errno;

148148

for fd in 0..3 {

149149

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 {

151151

// If the stream is closed but we failed to reopen it, abort the

152152

// process. Otherwise we wouldn't preserve the safety of

153153

// operations on the corresponding Rust object Stdin, Stdout, or