Skip to content

Commit 5bc6ce5

Browse files
authored
Fix clippy warnings for Rust 1.83 (mmtk#1242)
Clippy 1.83 produces some new warnings: - `needless_lifetimes` is extended to suggest eliding `impl` lifetimes. - `empty_line_after_doc_comments` is added to the `suspicious` group.
1 parent 8640ab8 commit 5bc6ce5

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

src/plan/global.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ pub struct CreateSpecificPlanArgs<'a, VM: VMBinding> {
390390
pub global_side_metadata_specs: Vec<SideMetadataSpec>,
391391
}
392392

393-
impl<'a, VM: VMBinding> CreateSpecificPlanArgs<'a, VM> {
393+
impl<VM: VMBinding> CreateSpecificPlanArgs<'_, VM> {
394394
/// Get a PlanCreateSpaceArgs that can be used to create a space
395395
pub fn get_space_args(
396396
&mut self,

src/plan/mutator_context.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ impl<VM: VMBinding> std::fmt::Debug for MutatorConfig<VM> {
8181
/// A mutator is a per-thread data structure that manages allocations and barriers. It is usually highly coupled with the language VM.
8282
/// It is recommended for MMTk users 1) to have a mutator struct of the same layout in the thread local storage that can be accessed efficiently,
8383
/// and 2) to implement fastpath allocation and barriers for the mutator in the VM side.
84-
8584
// We are trying to make this struct fixed-sized so that VM bindings can easily define a type to have the exact same layout as this struct.
8685
// Currently Mutator is fixed sized, and we should try keep this invariant:
8786
// - Allocators are fixed-length arrays of allocators.
@@ -256,7 +255,6 @@ impl<VM: VMBinding> Mutator<VM> {
256255

257256
/// Each GC plan should provide their implementation of a MutatorContext. *Note that this trait is no longer needed as we removed
258257
/// per-plan mutator implementation and we will remove this trait as well in the future.*
259-
260258
// TODO: We should be able to remove this trait, as we removed per-plan mutator implementation, and there is no other type that implements this trait.
261259
// The Mutator struct above is the only type that implements this trait. We should be able to merge them.
262260
pub trait MutatorContext<VM: VMBinding>: Send + 'static {

src/plan/tracing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'a, E: ProcessEdgesWork> ObjectsClosure<'a, E> {
111111
}
112112
}
113113

114-
impl<'a, E: ProcessEdgesWork> SlotVisitor<SlotOf<E>> for ObjectsClosure<'a, E> {
114+
impl<E: ProcessEdgesWork> SlotVisitor<SlotOf<E>> for ObjectsClosure<'_, E> {
115115
fn visit_slot(&mut self, slot: SlotOf<E>) {
116116
#[cfg(debug_assertions)]
117117
{
@@ -129,7 +129,7 @@ impl<'a, E: ProcessEdgesWork> SlotVisitor<SlotOf<E>> for ObjectsClosure<'a, E> {
129129
}
130130
}
131131

132-
impl<'a, E: ProcessEdgesWork> Drop for ObjectsClosure<'a, E> {
132+
impl<E: ProcessEdgesWork> Drop for ObjectsClosure<'_, E> {
133133
fn drop(&mut self) {
134134
self.flush();
135135
}

src/util/test_util/mock_vm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ pub fn no_cleanup() {}
180180
///
181181
/// These are not supported at the moment. As those will change the `MockVM` type, we will have
182182
/// to use macros to generate a new `MockVM` type when we custimize constants or associated types.
183-
184183
// The current implementation is not perfect, but at least it works, and it is easy enough to debug with.
185184
// I have tried different third-party libraries for mocking, and each has its own limitation. And
186185
// none of the libraries I tried can mock `VMBinding` and the associated traits out of box. Even after I attempted

0 commit comments

Comments
 (0)