Skip to content

Commit 13a4ac3

Browse files
committed
libstd: deny(elided_lifetimes_in_paths), fixes in wasi
1 parent 1852389 commit 13a4ac3

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

src/libstd/sys/wasi/fd.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@ pub type RiFlags = u16;
2323
pub type RoFlags = u16;
2424
pub type SiFlags = u16;
2525

26-
fn iovec(a: &mut [IoVecMut]) -> (*const libc::__wasi_iovec_t, usize) {
26+
fn iovec(a: &mut [IoVecMut<'_>]) -> (*const libc::__wasi_iovec_t, usize) {
2727
assert_eq!(
28-
mem::size_of::<IoVecMut>(),
28+
mem::size_of::<IoVecMut<'_>>(),
2929
mem::size_of::<libc::__wasi_iovec_t>()
3030
);
3131
assert_eq!(
32-
mem::align_of::<IoVecMut>(),
32+
mem::align_of::<IoVecMut<'_>>(),
3333
mem::align_of::<libc::__wasi_iovec_t>()
3434
);
3535
(a.as_ptr() as *const libc::__wasi_iovec_t, a.len())
3636
}
3737

38-
fn ciovec(a: &[IoVec]) -> (*const libc::__wasi_ciovec_t, usize) {
38+
fn ciovec(a: &[IoVec<'_>]) -> (*const libc::__wasi_ciovec_t, usize) {
3939
assert_eq!(
40-
mem::size_of::<IoVec>(),
40+
mem::size_of::<IoVec<'_>>(),
4141
mem::size_of::<libc::__wasi_ciovec_t>()
4242
);
4343
assert_eq!(
44-
mem::align_of::<IoVec>(),
44+
mem::align_of::<IoVec<'_>>(),
4545
mem::align_of::<libc::__wasi_ciovec_t>()
4646
);
4747
(a.as_ptr() as *const libc::__wasi_ciovec_t, a.len())
@@ -56,28 +56,28 @@ impl WasiFd {
5656
cvt_wasi(unsafe { libc::__wasi_fd_datasync(self.fd) })
5757
}
5858

59-
pub fn pread(&self, bufs: &mut [IoVecMut], offset: u64) -> io::Result<usize> {
59+
pub fn pread(&self, bufs: &mut [IoVecMut<'_>], offset: u64) -> io::Result<usize> {
6060
let mut read = 0;
6161
let (ptr, len) = iovec(bufs);
6262
cvt_wasi(unsafe { libc::__wasi_fd_pread(self.fd, ptr, len, offset, &mut read) })?;
6363
Ok(read)
6464
}
6565

66-
pub fn pwrite(&self, bufs: &[IoVec], offset: u64) -> io::Result<usize> {
66+
pub fn pwrite(&self, bufs: &[IoVec<'_>], offset: u64) -> io::Result<usize> {
6767
let mut read = 0;
6868
let (ptr, len) = ciovec(bufs);
6969
cvt_wasi(unsafe { libc::__wasi_fd_pwrite(self.fd, ptr, len, offset, &mut read) })?;
7070
Ok(read)
7171
}
7272

73-
pub fn read(&self, bufs: &mut [IoVecMut]) -> io::Result<usize> {
73+
pub fn read(&self, bufs: &mut [IoVecMut<'_>]) -> io::Result<usize> {
7474
let mut read = 0;
7575
let (ptr, len) = iovec(bufs);
7676
cvt_wasi(unsafe { libc::__wasi_fd_read(self.fd, ptr, len, &mut read) })?;
7777
Ok(read)
7878
}
7979

80-
pub fn write(&self, bufs: &[IoVec]) -> io::Result<usize> {
80+
pub fn write(&self, bufs: &[IoVec<'_>]) -> io::Result<usize> {
8181
let mut read = 0;
8282
let (ptr, len) = ciovec(bufs);
8383
cvt_wasi(unsafe { libc::__wasi_fd_write(self.fd, ptr, len, &mut read) })?;
@@ -281,7 +281,7 @@ impl WasiFd {
281281

282282
pub fn sock_recv(
283283
&self,
284-
ri_data: &mut [IoVecMut],
284+
ri_data: &mut [IoVecMut<'_>],
285285
ri_flags: RiFlags,
286286
) -> io::Result<(usize, RoFlags)> {
287287
let mut ro_datalen = 0;
@@ -293,7 +293,7 @@ impl WasiFd {
293293
Ok((ro_datalen, ro_flags))
294294
}
295295

296-
pub fn sock_send(&self, si_data: &[IoVec], si_flags: SiFlags) -> io::Result<usize> {
296+
pub fn sock_send(&self, si_data: &[IoVec<'_>], si_flags: SiFlags) -> io::Result<usize> {
297297
let mut so_datalen = 0;
298298
let (ptr, len) = ciovec(si_data);
299299
cvt_wasi(unsafe { libc::__wasi_sock_send(self.fd, ptr, len, si_flags, &mut so_datalen) })?;

src/libstd/sys/wasi/fs.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl Eq for FilePermissions {
8282
}
8383

8484
impl fmt::Debug for FilePermissions {
85-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
85+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
8686
match self.0 {}
8787
}
8888
}
@@ -125,13 +125,13 @@ impl Hash for FileType {
125125
}
126126

127127
impl fmt::Debug for FileType {
128-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
128+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
129129
match self.0 {}
130130
}
131131
}
132132

133133
impl fmt::Debug for ReadDir {
134-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
134+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
135135
match self.0 {}
136136
}
137137
}
@@ -236,7 +236,7 @@ impl DirBuilder {
236236
}
237237

238238
impl fmt::Debug for File {
239-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
239+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
240240
match self.0 {}
241241
}
242242
}

src/libstd/sys/wasi/net.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl TcpStream {
9494
}
9595

9696
impl fmt::Debug for TcpStream {
97-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
97+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
9898
match self.0 {}
9999
}
100100
}
@@ -144,7 +144,7 @@ impl TcpListener {
144144
}
145145

146146
impl fmt::Debug for TcpListener {
147-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
147+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
148148
match self.0 {}
149149
}
150150
}
@@ -282,7 +282,7 @@ impl UdpSocket {
282282
}
283283

284284
impl fmt::Debug for UdpSocket {
285-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
285+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
286286
match self.0 {}
287287
}
288288
}

src/libstd/sys/wasi/os.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn chdir(_: &path::Path) -> io::Result<()> {
4141

4242
pub struct SplitPaths<'a>(&'a Void);
4343

44-
pub fn split_paths(_unparsed: &OsStr) -> SplitPaths {
44+
pub fn split_paths(_unparsed: &OsStr) -> SplitPaths<'_> {
4545
panic!("unsupported")
4646
}
4747

@@ -62,7 +62,7 @@ pub fn join_paths<I, T>(_paths: I) -> Result<OsString, JoinPathsError>
6262
}
6363

6464
impl fmt::Display for JoinPathsError {
65-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
65+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6666
"not supported on wasm yet".fmt(f)
6767
}
6868
}

src/libstd/sys/wasi/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn is_verbatim_sep(b: u8) -> bool {
1111
b == b'/'
1212
}
1313

14-
pub fn parse_prefix(_: &OsStr) -> Option<Prefix> {
14+
pub fn parse_prefix(_: &OsStr) -> Option<Prefix<'_>> {
1515
None
1616
}
1717

src/libstd/sys/wasi/process.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl From<File> for Stdio {
7373
}
7474

7575
impl fmt::Debug for Command {
76-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
76+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
7777
Ok(())
7878
}
7979
}
@@ -108,13 +108,13 @@ impl Eq for ExitStatus {
108108
}
109109

110110
impl fmt::Debug for ExitStatus {
111-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
111+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
112112
match self.0 {}
113113
}
114114
}
115115

116116
impl fmt::Display for ExitStatus {
117-
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
117+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
118118
match self.0 {}
119119
}
120120
}

0 commit comments

Comments
 (0)