emilk / emilk/egui

Remove `Clone` bound from `insert_temp` in `IdTypeMap`

Open
#6,898 0 comments 0 reactions 0 assignees View on GitHub
egui feature
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

I've had a couple times where I wanted to store something non-clone in Memory and was forced to do something like
```rs
impl Clone for ... {
fn clone() { panic!() }
}
```
which was fine since I knew I never call clone on Memory and egui doesn't either.

**Describe the solution you'd like**
Remove the Clone bound for `insert_temp` or add `insert_temp_non_clone`

**Describe alternatives you've considered**
Somehow make the thing I want to save Clone or do the panic-on-clone.

**Additional context**
Slack discussion:
https://rerunio.slack.com/archives/C083DK8C9FC/p1745934846335169

Rerun PR comment where this showed up:
https://github.com/rerun-io/rerun/pull/9764

Contributor guide

Open the contributing guide

Research direction

Start by locating IdTypeMap::insert_temp and inspecting its Clone bound and nearby Memory APIs. Compare the requested removal with the alternative insert_temp_non_clone, then verify that a non-Clone value can be stored in Memory without requiring a panic-on-clone workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.