Add a values_since_snapshot method to UnificationStore#19
Add a values_since_snapshot method to UnificationStore#19nikomatsakis merged 2 commits intorust-lang:masterfrom
values_since_snapshot method to UnificationStore#19Conversation
93fe943 to
bdbaa65
Compare
| #[allow(type_alias_bounds)] | ||
| type Key<S: UnificationStore> = <S as UnificationStore>::Key; | ||
|
|
||
| pub trait Measurable { |
There was a problem hiding this comment.
Can we add a doc comment to this trait? Maybe explain what this len represents? (I realize the old method didn't have a comment, sorry, I'm a hypocrite)
There was a problem hiding this comment.
I would've named this trait Length, really.
Or rely on ExactSizeIterator::len somehow.
There was a problem hiding this comment.
Yeah, I considered that (and seeing whether I could incorporate ExactSizeIterator::len), but it didn't quite seem accurate: I wanted a word for something that had a length, rather than was a length. It's only supposed to be used internally though, so it's not too important.
|
Never mind, I thought that |
We'd like to abstract out the
vars_since_snapshotmethods for inference variables in rustc:https://github.com/rust-lang/rust/blob/2a8f6a7806a9072fb5a5279a48bef316b749a433/src/librustc/infer/fudge.rs#L67-L72
At the moment, we can't get this information for an arbitrary
UnificationStore, which means there are some awkward workarounds in the compiler.