Skip to content

Commit 48f244c

Browse files
authored
Fix Clippy 1.89 warnings (#1367)
Clippy 1.89 starts to warn about `mismatched_lifetime_syntaxes`. We fix our function signatures by adding `'_` in the return types.
1 parent 83dc4c4 commit 48f244c

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

src/plan/global.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ impl<VM: VMBinding> CreateSpecificPlanArgs<'_, VM> {
410410
zeroed: bool,
411411
permission_exec: bool,
412412
vmrequest: VMRequest,
413-
) -> PlanCreateSpaceArgs<VM> {
413+
) -> PlanCreateSpaceArgs<'_, VM> {
414414
PlanCreateSpaceArgs {
415415
name,
416416
zeroed,

src/scheduler/worker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ const STAT_BORROWED_MSG: &str = "GCWorkerShared.stat is already borrowed. This
111111
the mutator calls harness_begin or harness_end while the GC is running.";
112112

113113
impl<VM: VMBinding> GCWorkerShared<VM> {
114-
pub fn borrow_stat(&self) -> AtomicRef<WorkerLocalStat<VM>> {
114+
pub fn borrow_stat(&self) -> AtomicRef<'_, WorkerLocalStat<VM>> {
115115
self.stat.try_borrow().expect(STAT_BORROWED_MSG)
116116
}
117117

118-
pub fn borrow_stat_mut(&self) -> AtomicRefMut<WorkerLocalStat<VM>> {
118+
pub fn borrow_stat_mut(&self) -> AtomicRefMut<'_, WorkerLocalStat<VM>> {
119119
self.stat.try_borrow_mut().expect(STAT_BORROWED_MSG)
120120
}
121121
}

src/util/heap/externalpageresource.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<VM: VMBinding> ExternalPageResource<VM> {
7777
lock.push(pages);
7878
}
7979

80-
pub fn get_external_pages(&self) -> MutexGuard<Vec<ExternalPages>> {
80+
pub fn get_external_pages(&self) -> MutexGuard<'_, Vec<ExternalPages>> {
8181
self.ranges.lock().unwrap()
8282
}
8383
}

src/util/heap/layout/map32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl Map32 {
268268
/// Get a mutable reference to the inner Map32Inner with a lock.
269269
/// The caller should only use the mutable reference while holding the lock.
270270
#[allow(clippy::mut_from_ref)]
271-
fn mut_self_with_sync(&self) -> (MutexGuard<()>, &mut Map32Inner) {
271+
fn mut_self_with_sync(&self) -> (MutexGuard<'_, ()>, &mut Map32Inner) {
272272
let guard = self.sync.lock().unwrap();
273273
(guard, unsafe { self.mut_self() })
274274
}

src/vm/tests/mock_tests/mock_test_doc_weakref_code_example.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ struct VMScanning;
1616
// Just to make the code example look better.
1717
use MockVM as MyVM;
1818

19-
// Placeholders for functions supposed to be implemented byu the VM.
19+
// Placeholders for functions supposed to be implemented by the VM.
20+
#[allow(dead_code)]
2021
mod my_vm {
2122
use crate::util::ObjectReference;
2223

0 commit comments

Comments
 (0)