Skip to content

Commit 1fa63f1

Browse files
committed
Resolve clippy::extra_unused_lifetimes
error: this lifetime isn't used in the function definition --> src/helpers.rs:46:20 | 46 | fn try_resolve_did<'mir, 'tcx>(tcx: TyCtxt<'tcx>, path: &[&str]) -> Option<DefId> { | ^^^^ | = note: `-D clippy::extra-unused-lifetimes` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes error: this lifetime isn't used in the function definition --> src/shims/posix/fs.rs:49:12 | 49 | fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>>; | ^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes error: this lifetime isn't used in the function definition --> src/shims/os_str.rs:81:41 | 81 | pub fn u16vec_to_osstring<'tcx, 'a>(u16_vec: Vec<u16>) -> InterpResult<'tcx, OsString> { | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes error: this lifetime isn't used in the function definition --> src/thread.rs:72:26 | 72 | pub fn to_u32_scalar<'tcx>(&self) -> Scalar<Tag> { | ^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
1 parent 9125cc1 commit 1fa63f1

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const UNIX_IO_ERROR_TABLE: &[(std::io::ErrorKind, &str)] = {
4343
};
4444

4545
/// Gets an instance for a path.
46-
fn try_resolve_did<'mir, 'tcx>(tcx: TyCtxt<'tcx>, path: &[&str]) -> Option<DefId> {
46+
fn try_resolve_did<'tcx>(tcx: TyCtxt<'tcx>, path: &[&str]) -> Option<DefId> {
4747
tcx.crates(()).iter().find(|&&krate| tcx.crate_name(krate).as_str() == path[0]).and_then(
4848
|krate| {
4949
let krate = DefId { krate: *krate, index: CRATE_DEF_INDEX };

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
clippy::collapsible_if,
1515
clippy::comparison_chain,
1616
clippy::enum_variant_names,
17-
clippy::extra_unused_lifetimes,
1817
clippy::field_reassign_with_default,
1918
clippy::from_over_into,
2019
clippy::if_same_then_else,

src/shims/os_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
7878
Ok(OsString::from_wide(&u16_vec[..]))
7979
}
8080
#[cfg(not(windows))]
81-
pub fn u16vec_to_osstring<'tcx, 'a>(u16_vec: Vec<u16>) -> InterpResult<'tcx, OsString> {
81+
pub fn u16vec_to_osstring<'tcx>(u16_vec: Vec<u16>) -> InterpResult<'tcx, OsString> {
8282
let s = String::from_utf16(&u16_vec[..])
8383
.map_err(|_| err_unsup_format!("{:?} is not a valid utf-16 string", u16_vec))?;
8484
Ok(s.into())

src/shims/posix/fs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ trait FileDescriptor: std::fmt::Debug {
4646
_communicate_allowed: bool,
4747
) -> InterpResult<'tcx, io::Result<i32>>;
4848

49-
fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>>;
49+
fn dup(&mut self) -> io::Result<Box<dyn FileDescriptor>>;
5050
}
5151

5252
impl FileDescriptor for FileHandle {
@@ -107,7 +107,7 @@ impl FileDescriptor for FileHandle {
107107
}
108108
}
109109

110-
fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
110+
fn dup(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
111111
let duplicated = self.file.try_clone()?;
112112
Ok(Box::new(FileHandle { file: duplicated, writable: self.writable }))
113113
}
@@ -153,7 +153,7 @@ impl FileDescriptor for io::Stdin {
153153
throw_unsup_format!("stdin cannot be closed");
154154
}
155155

156-
fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
156+
fn dup(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
157157
Ok(Box::new(io::stdin()))
158158
}
159159
}
@@ -203,7 +203,7 @@ impl FileDescriptor for io::Stdout {
203203
throw_unsup_format!("stdout cannot be closed");
204204
}
205205

206-
fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
206+
fn dup(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
207207
Ok(Box::new(io::stdout()))
208208
}
209209
}
@@ -246,7 +246,7 @@ impl FileDescriptor for io::Stderr {
246246
throw_unsup_format!("stderr cannot be closed");
247247
}
248248

249-
fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
249+
fn dup(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
250250
Ok(Box::new(io::stderr()))
251251
}
252252
}

src/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl From<u32> for ThreadId {
6969
}
7070

7171
impl ThreadId {
72-
pub fn to_u32_scalar<'tcx>(&self) -> Scalar<Tag> {
72+
pub fn to_u32_scalar(&self) -> Scalar<Tag> {
7373
Scalar::from_u32(u32::try_from(self.0).unwrap())
7474
}
7575
}

0 commit comments

Comments
 (0)