Skip to content

Commit 0bc236a

Browse files
authored
Merge pull request RustPython#5450 from key262yek/resolve_lint_fails_w_rust_1.83_clippy
Resolve lint fails w rust 1.83 clippy
2 parents 3b6db8e + da3d3d9 commit 0bc236a

File tree

17 files changed

+40
-40
lines changed

17 files changed

+40
-40
lines changed

common/src/boxvec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ pub struct Drain<'a, T> {
468468
vec: ptr::NonNull<BoxVec<T>>,
469469
}
470470

471-
unsafe impl<'a, T: Sync> Sync for Drain<'a, T> {}
472-
unsafe impl<'a, T: Sync> Send for Drain<'a, T> {}
471+
unsafe impl<T: Sync> Sync for Drain<'_, T> {}
472+
unsafe impl<T: Sync> Send for Drain<'_, T> {}
473473

474474
impl<T> Iterator for Drain<'_, T> {
475475
type Item = T;

common/src/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ impl<T: Link> LinkedList<T, T::Target> {
293293
}
294294
}
295295

296-
impl<'a, T, F> Iterator for DrainFilter<'a, T, F>
296+
impl<T, F> Iterator for DrainFilter<'_, T, F>
297297
where
298298
T: Link,
299299
F: FnMut(&mut T::Target) -> bool,

common/src/lock/immutable_mutex.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,28 @@ impl<'a, R: RawMutex, T: ?Sized> ImmutableMappedMutexGuard<'a, R, T> {
4545
}
4646
}
4747

48-
impl<'a, R: RawMutex, T: ?Sized> Deref for ImmutableMappedMutexGuard<'a, R, T> {
48+
impl<R: RawMutex, T: ?Sized> Deref for ImmutableMappedMutexGuard<'_, R, T> {
4949
type Target = T;
5050
fn deref(&self) -> &Self::Target {
5151
// SAFETY: self.data is valid for the lifetime of the guard
5252
unsafe { &*self.data }
5353
}
5454
}
5555

56-
impl<'a, R: RawMutex, T: ?Sized> Drop for ImmutableMappedMutexGuard<'a, R, T> {
56+
impl<R: RawMutex, T: ?Sized> Drop for ImmutableMappedMutexGuard<'_, R, T> {
5757
fn drop(&mut self) {
5858
// SAFETY: An ImmutableMappedMutexGuard always holds the lock
5959
unsafe { self.raw.unlock() }
6060
}
6161
}
6262

63-
impl<'a, R: RawMutex, T: fmt::Debug + ?Sized> fmt::Debug for ImmutableMappedMutexGuard<'a, R, T> {
63+
impl<R: RawMutex, T: fmt::Debug + ?Sized> fmt::Debug for ImmutableMappedMutexGuard<'_, R, T> {
6464
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6565
fmt::Debug::fmt(&**self, f)
6666
}
6767
}
6868

69-
impl<'a, R: RawMutex, T: fmt::Display + ?Sized> fmt::Display
70-
for ImmutableMappedMutexGuard<'a, R, T>
71-
{
69+
impl<R: RawMutex, T: fmt::Display + ?Sized> fmt::Display for ImmutableMappedMutexGuard<'_, R, T> {
7270
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7371
fmt::Display::fmt(&**self, f)
7472
}

common/src/lock/thread_mutex.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,31 +192,31 @@ impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized> ThreadMutexGuard<'a, R, G, T> {
192192
}
193193
}
194194
}
195-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized> Deref for ThreadMutexGuard<'a, R, G, T> {
195+
impl<R: RawMutex, G: GetThreadId, T: ?Sized> Deref for ThreadMutexGuard<'_, R, G, T> {
196196
type Target = T;
197197
fn deref(&self) -> &T {
198198
unsafe { &*self.mu.data.get() }
199199
}
200200
}
201-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized> DerefMut for ThreadMutexGuard<'a, R, G, T> {
201+
impl<R: RawMutex, G: GetThreadId, T: ?Sized> DerefMut for ThreadMutexGuard<'_, R, G, T> {
202202
fn deref_mut(&mut self) -> &mut T {
203203
unsafe { &mut *self.mu.data.get() }
204204
}
205205
}
206-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized> Drop for ThreadMutexGuard<'a, R, G, T> {
206+
impl<R: RawMutex, G: GetThreadId, T: ?Sized> Drop for ThreadMutexGuard<'_, R, G, T> {
207207
fn drop(&mut self) {
208208
unsafe { self.mu.raw.unlock() }
209209
}
210210
}
211-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized + fmt::Display> fmt::Display
212-
for ThreadMutexGuard<'a, R, G, T>
211+
impl<R: RawMutex, G: GetThreadId, T: ?Sized + fmt::Display> fmt::Display
212+
for ThreadMutexGuard<'_, R, G, T>
213213
{
214214
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
215215
fmt::Display::fmt(&**self, f)
216216
}
217217
}
218-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized + fmt::Debug> fmt::Debug
219-
for ThreadMutexGuard<'a, R, G, T>
218+
impl<R: RawMutex, G: GetThreadId, T: ?Sized + fmt::Debug> fmt::Debug
219+
for ThreadMutexGuard<'_, R, G, T>
220220
{
221221
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
222222
fmt::Debug::fmt(&**self, f)
@@ -259,31 +259,31 @@ impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized> MappedThreadMutexGuard<'a, R, G
259259
}
260260
}
261261
}
262-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized> Deref for MappedThreadMutexGuard<'a, R, G, T> {
262+
impl<R: RawMutex, G: GetThreadId, T: ?Sized> Deref for MappedThreadMutexGuard<'_, R, G, T> {
263263
type Target = T;
264264
fn deref(&self) -> &T {
265265
unsafe { self.data.as_ref() }
266266
}
267267
}
268-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized> DerefMut for MappedThreadMutexGuard<'a, R, G, T> {
268+
impl<R: RawMutex, G: GetThreadId, T: ?Sized> DerefMut for MappedThreadMutexGuard<'_, R, G, T> {
269269
fn deref_mut(&mut self) -> &mut T {
270270
unsafe { self.data.as_mut() }
271271
}
272272
}
273-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized> Drop for MappedThreadMutexGuard<'a, R, G, T> {
273+
impl<R: RawMutex, G: GetThreadId, T: ?Sized> Drop for MappedThreadMutexGuard<'_, R, G, T> {
274274
fn drop(&mut self) {
275275
unsafe { self.mu.unlock() }
276276
}
277277
}
278-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized + fmt::Display> fmt::Display
279-
for MappedThreadMutexGuard<'a, R, G, T>
278+
impl<R: RawMutex, G: GetThreadId, T: ?Sized + fmt::Display> fmt::Display
279+
for MappedThreadMutexGuard<'_, R, G, T>
280280
{
281281
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
282282
fmt::Display::fmt(&**self, f)
283283
}
284284
}
285-
impl<'a, R: RawMutex, G: GetThreadId, T: ?Sized + fmt::Debug> fmt::Debug
286-
for MappedThreadMutexGuard<'a, R, G, T>
285+
impl<R: RawMutex, G: GetThreadId, T: ?Sized + fmt::Debug> fmt::Debug
286+
for MappedThreadMutexGuard<'_, R, G, T>
287287
{
288288
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
289289
fmt::Debug::fmt(&**self, f)

jit/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ pub struct Args<'a> {
341341
code: &'a CompiledCode,
342342
}
343343

344-
impl<'a> Args<'a> {
344+
impl Args<'_> {
345345
pub fn invoke(&self) -> Option<AbiValue> {
346346
unsafe { self.code.invoke_raw(&self.cif_args) }
347347
}

stdlib/src/posixsubprocess.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct CharPtrSlice<'a> {
113113
slice: [*const libc::c_char],
114114
}
115115

116-
impl<'a> CharPtrSlice<'a> {
116+
impl CharPtrSlice<'_> {
117117
fn as_ptr(&self) -> *const *const libc::c_char {
118118
self.slice.as_ptr()
119119
}

stdlib/src/sqlite.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,9 @@ mod _sqlite {
10041004
)
10051005
}
10061006

1007+
// TODO: Make it build without clippy::manual_c_str_literals
10071008
#[pymethod]
1009+
#[allow(clippy::manual_c_str_literals)]
10081010
fn backup(zelf: &Py<Self>, args: BackupArgs, vm: &VirtualMachine) -> PyResult<()> {
10091011
let BackupArgs {
10101012
target,

stdlib/src/ssl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ mod bio {
15031503

15041504
pub struct MemBioSlice<'a>(*mut sys::BIO, PhantomData<&'a [u8]>);
15051505

1506-
impl<'a> Drop for MemBioSlice<'a> {
1506+
impl Drop for MemBioSlice<'_> {
15071507
fn drop(&mut self) {
15081508
unsafe {
15091509
sys::BIO_free_all(self.0);

vm/src/object/ext.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,29 +500,29 @@ pub struct PyLease<'a, T: PyObjectPayload> {
500500
inner: PyRwLockReadGuard<'a, PyRef<T>>,
501501
}
502502

503-
impl<'a, T: PyObjectPayload + PyPayload> PyLease<'a, T> {
503+
impl<T: PyObjectPayload + PyPayload> PyLease<'_, T> {
504504
#[inline(always)]
505505
pub fn into_owned(self) -> PyRef<T> {
506506
self.inner.clone()
507507
}
508508
}
509509

510-
impl<'a, T: PyObjectPayload + PyPayload> Borrow<PyObject> for PyLease<'a, T> {
510+
impl<T: PyObjectPayload + PyPayload> Borrow<PyObject> for PyLease<'_, T> {
511511
#[inline(always)]
512512
fn borrow(&self) -> &PyObject {
513513
self.inner.as_ref()
514514
}
515515
}
516516

517-
impl<'a, T: PyObjectPayload + PyPayload> Deref for PyLease<'a, T> {
517+
impl<T: PyObjectPayload + PyPayload> Deref for PyLease<'_, T> {
518518
type Target = PyRef<T>;
519519
#[inline(always)]
520520
fn deref(&self) -> &Self::Target {
521521
&self.inner
522522
}
523523
}
524524

525-
impl<'a, T> fmt::Display for PyLease<'a, T>
525+
impl<T> fmt::Display for PyLease<'_, T>
526526
where
527527
T: PyPayload + fmt::Display,
528528
{

vm/src/ospath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl<'a> IOErrorBuilder<'a> {
179179
}
180180
}
181181

182-
impl<'a> ToPyException for IOErrorBuilder<'a> {
182+
impl ToPyException for IOErrorBuilder<'_> {
183183
fn to_pyexception(&self, vm: &VirtualMachine) -> PyBaseExceptionRef {
184184
let excp = self.error.to_pyexception(vm);
185185

0 commit comments

Comments
 (0)