Skip to content

Commit 45f9915

Browse files
committed
Fix clippy warnings
1 parent ae9a693 commit 45f9915

File tree

5 files changed

+14
-27
lines changed

5 files changed

+14
-27
lines changed

gc/mmtk/src/api.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ pub extern "C" fn mmtk_builder_default() -> *mut MMTKBuilder {
108108
if !builder.options.threads.set(threads) {
109109
// MMTk will validate it and reject 0.
110110
eprintln!(
111-
"[FATAL] Failed to set the number of MMTk threads to {}",
112-
threads
111+
"[FATAL] Failed to set the number of MMTk threads to {threads}"
113112
);
114113
std::process::exit(1);
115114
}
@@ -121,8 +120,7 @@ pub extern "C" fn mmtk_builder_default() -> *mut MMTKBuilder {
121120

122121
if heap_min >= heap_max {
123122
eprintln!(
124-
"[FATAL] MMTK_HEAP_MIN({}) >= MMTK_HEAP_MAX({})",
125-
heap_min, heap_max
123+
"[FATAL] MMTK_HEAP_MIN({heap_min}) >= MMTK_HEAP_MAX({heap_max})"
126124
);
127125
std::process::exit(1);
128126
}

gc/mmtk/src/binding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl RubyBinding {
119119
}
120120

121121
pub fn register_wb_unprotected_object(&self, object: ObjectReference) {
122-
debug!("Registering WB-unprotected object: {}", object);
122+
debug!("Registering WB-unprotected object: {object}");
123123
let mut objects = self.wb_unprotected_objects.lock().unwrap();
124124
objects.insert(object);
125125
}

gc/mmtk/src/collection.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ impl Collection<Ruby> for VMCollection {
4242
.spawn(move || {
4343
let ordinal = worker.ordinal;
4444
debug!(
45-
"Hello! This is MMTk Worker Thread running! ordinal: {}",
46-
ordinal
45+
"Hello! This is MMTk Worker Thread running! ordinal: {ordinal}"
4746
);
4847
crate::register_gc_thread(thread::current().id());
4948
let ptr_worker = &mut *worker as *mut GCWorker<Ruby>;
@@ -56,8 +55,7 @@ impl Collection<Ruby> for VMCollection {
5655
worker,
5756
);
5857
debug!(
59-
"An MMTk Worker Thread is quitting. Good bye! ordinal: {}",
60-
ordinal
58+
"An MMTk Worker Thread is quitting. Good bye! ordinal: {ordinal}"
6159
);
6260
crate::unregister_gc_thread(thread::current().id());
6361
})

gc/mmtk/src/scanning.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ impl Scanning<Ruby> for VMScanning {
4848
let forwarded_target = object_tracer.trace_object(target_object);
4949
if forwarded_target != target_object {
5050
trace!(
51-
" Forwarded target {} -> {}",
52-
target_object,
53-
forwarded_target
51+
" Forwarded target {target_object} -> {forwarded_target}"
5452
);
5553
}
5654
forwarded_target
@@ -252,14 +250,12 @@ impl<F: RootsWorkFactory<RubySlot>> GCWork<Ruby> for ScanWbUnprotectedRoots<F> {
252250
for object in self.objects.iter().copied() {
253251
if object.is_reachable() {
254252
debug!(
255-
"[wb_unprot_roots] Visiting WB-unprotected object (parent): {}",
256-
object
253+
"[wb_unprot_roots] Visiting WB-unprotected object (parent): {object}"
257254
);
258255
(upcalls().scan_object_ruby_style)(object);
259256
} else {
260257
debug!(
261-
"[wb_unprot_roots] Skipping young WB-unprotected object (parent): {}",
262-
object
258+
"[wb_unprot_roots] Skipping young WB-unprotected object (parent): {object}"
263259
);
264260
}
265261
}

gc/mmtk/src/weak_proc.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl GCWork<Ruby> for ProcessObjFreeCandidates {
103103

104104
let n_cands = obj_free_candidates.len();
105105

106-
debug!("Total: {} candidates", n_cands);
106+
debug!("Total: {n_cands} candidates");
107107

108108
// Process obj_free
109109
let mut new_candidates = Vec::new();
@@ -113,9 +113,7 @@ impl GCWork<Ruby> for ProcessObjFreeCandidates {
113113
// Forward and add back to the candidate list.
114114
let new_object = object.forward();
115115
trace!(
116-
"Forwarding obj_free candidate: {} -> {}",
117-
object,
118-
new_object
116+
"Forwarding obj_free candidate: {object} -> {new_object}"
119117
);
120118
new_candidates.push(new_object);
121119
} else {
@@ -158,11 +156,10 @@ trait GlobalTableProcessingWork {
158156
let forward_object = |_worker, object: ObjectReference, _pin| {
159157
debug_assert!(
160158
mmtk::memory_manager::is_mmtk_object(object.to_raw_address()).is_some(),
161-
"{} is not an MMTk object",
162-
object
159+
"{object} is not an MMTk object"
163160
);
164161
let result = object.forward();
165-
trace!("Forwarding reference: {} -> {}", object, result);
162+
trace!("Forwarding reference: {object} -> {result}");
166163
result
167164
};
168165

@@ -217,13 +214,11 @@ impl GCWork<Ruby> for UpdateWbUnprotectedObjectsList {
217214
// Forward and add back to the candidate list.
218215
let new_object = object.forward();
219216
trace!(
220-
"Forwarding WB-unprotected object: {} -> {}",
221-
object,
222-
new_object
217+
"Forwarding WB-unprotected object: {object} -> {new_object}"
223218
);
224219
objects.insert(new_object);
225220
} else {
226-
trace!("Removing WB-unprotected object from list: {}", object);
221+
trace!("Removing WB-unprotected object from list: {object}");
227222
}
228223
}
229224

0 commit comments

Comments
 (0)