diff options
| author | Ralf Jung <post@ralfj.de> | 2023-07-25 22:35:07 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-07-25 22:35:07 +0200 |
| commit | da3f0d0eb7ced3d4967dcac01ddd2edef8f43b85 (patch) | |
| tree | 0e08e8b822bbf9def79446e844cb41fb756a9842 /compiler/rustc_const_eval/src/interpret/validity.rs | |
| parent | 77ff1b83cd3279c348312e1e1f9bf6a1c1174178 (diff) | |
| download | rust-da3f0d0eb7ced3d4967dcac01ddd2edef8f43b85.tar.gz rust-da3f0d0eb7ced3d4967dcac01ddd2edef8f43b85.zip | |
make MPlaceTy non-Copy
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/validity.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/validity.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index a82c98e7205..4fd5fd13c3c 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -136,19 +136,19 @@ pub struct RefTracking<T, PATH = ()> { pub todo: Vec<(T, PATH)>, } -impl<T: Copy + Eq + Hash + std::fmt::Debug, PATH: Default> RefTracking<T, PATH> { +impl<T: Clone + Eq + Hash + std::fmt::Debug, PATH: Default> RefTracking<T, PATH> { pub fn empty() -> Self { RefTracking { seen: FxHashSet::default(), todo: vec![] } } pub fn new(op: T) -> Self { let mut ref_tracking_for_consts = - RefTracking { seen: FxHashSet::default(), todo: vec![(op, PATH::default())] }; + RefTracking { seen: FxHashSet::default(), todo: vec![(op.clone(), PATH::default())] }; ref_tracking_for_consts.seen.insert(op); ref_tracking_for_consts } pub fn track(&mut self, op: T, path: impl FnOnce() -> PATH) { - if self.seen.insert(op) { + if self.seen.insert(op.clone()) { trace!("Recursing below ptr {:#?}", op); let path = path(); // Remember to come back to this later. |
