Skip to content

Commit

Permalink
Do not take &mut in Tracer::trace_static
Browse files Browse the repository at this point in the history
Summary:
When implementing `Trace` for `HashMap`, `iter_mut` returns `&K`, which cannot be fed to `trace_static`.

Like in the following diff D53944118.

Reviewed By: JakobDegen

Differential Revision: D53944197

fbshipit-source-id: afca74dbb995737970ba17dd2894e1dd2c295666
  • Loading branch information
stepancheg authored and facebook-github-bot committed Feb 20, 2024
1 parent 0a8b9b8 commit b78829a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion starlark/src/values/layout/heap/heap_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ impl<'v> Tracer<'v> {
/// Helper function to annotate that this field has been considered for tracing,
/// but is not relevant because it has a static lifetime containing no relevant values.
/// Does nothing.
pub fn trace_static<T: 'static>(&self, value: &mut T) {
pub fn trace_static<T: 'static>(&self, value: &T) {
// Nothing to do because T can't contain the lifetime 'v
let _ = value;
}
Expand Down

0 comments on commit b78829a

Please sign in to comment.