mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Add back equality check that went missing
This commit is contained in:
parent
a324e46b0b
commit
09ef75c717
2 changed files with 8 additions and 1 deletions
|
@ -43,6 +43,7 @@ where
|
||||||
impl<Q> DerivedStorage<Q>
|
impl<Q> DerivedStorage<Q>
|
||||||
where
|
where
|
||||||
Q: QueryFunction,
|
Q: QueryFunction,
|
||||||
|
Q::Value: Eq,
|
||||||
{
|
{
|
||||||
fn slot(&self, key: &Q::Key) -> Arc<Slot<Q>> {
|
fn slot(&self, key: &Q::Key) -> Arc<Slot<Q>> {
|
||||||
if let Some(v) = self.slot_map.read().get(key) {
|
if let Some(v) = self.slot_map.read().get(key) {
|
||||||
|
@ -64,6 +65,7 @@ where
|
||||||
impl<Q> QueryStorageOps<Q> for DerivedStorage<Q>
|
impl<Q> QueryStorageOps<Q> for DerivedStorage<Q>
|
||||||
where
|
where
|
||||||
Q: QueryFunction,
|
Q: QueryFunction,
|
||||||
|
Q::Value: Eq,
|
||||||
{
|
{
|
||||||
const CYCLE_STRATEGY: crate::plumbing::CycleRecoveryStrategy = Q::CYCLE_STRATEGY;
|
const CYCLE_STRATEGY: crate::plumbing::CycleRecoveryStrategy = Q::CYCLE_STRATEGY;
|
||||||
|
|
||||||
|
@ -139,6 +141,7 @@ where
|
||||||
impl<Q> DerivedQueryStorageOps<Q> for DerivedStorage<Q>
|
impl<Q> DerivedQueryStorageOps<Q> for DerivedStorage<Q>
|
||||||
where
|
where
|
||||||
Q: QueryFunction,
|
Q: QueryFunction,
|
||||||
|
Q::Value: Eq,
|
||||||
{
|
{
|
||||||
fn invalidate<S>(&self, runtime: &mut Runtime, key: &S)
|
fn invalidate<S>(&self, runtime: &mut Runtime, key: &S)
|
||||||
where
|
where
|
||||||
|
|
|
@ -94,6 +94,7 @@ enum MaybeChangedSinceProbeState<G> {
|
||||||
impl<Q> Slot<Q>
|
impl<Q> Slot<Q>
|
||||||
where
|
where
|
||||||
Q: QueryFunction,
|
Q: QueryFunction,
|
||||||
|
Q::Value: Eq,
|
||||||
{
|
{
|
||||||
pub(super) fn new(database_key_index: DatabaseKeyIndex) -> Self {
|
pub(super) fn new(database_key_index: DatabaseKeyIndex) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
@ -270,7 +271,7 @@ where
|
||||||
// used to be, that is a "breaking change" that our
|
// used to be, that is a "breaking change" that our
|
||||||
// consumers must be aware of. Becoming *more* durable
|
// consumers must be aware of. Becoming *more* durable
|
||||||
// is not. See the test `constant_to_non_constant`.
|
// is not. See the test `constant_to_non_constant`.
|
||||||
if revisions.durability >= old_memo.revisions.durability {
|
if revisions.durability >= old_memo.revisions.durability && old_memo.value == value {
|
||||||
debug!(
|
debug!(
|
||||||
"read_upgrade({:?}): value is equal, back-dating to {:?}",
|
"read_upgrade({:?}): value is equal, back-dating to {:?}",
|
||||||
self, old_memo.revisions.changed_at,
|
self, old_memo.revisions.changed_at,
|
||||||
|
@ -550,6 +551,7 @@ where
|
||||||
struct PanicGuard<'me, Q>
|
struct PanicGuard<'me, Q>
|
||||||
where
|
where
|
||||||
Q: QueryFunction,
|
Q: QueryFunction,
|
||||||
|
Q::Value: Eq,
|
||||||
{
|
{
|
||||||
slot: &'me Slot<Q>,
|
slot: &'me Slot<Q>,
|
||||||
runtime: &'me Runtime,
|
runtime: &'me Runtime,
|
||||||
|
@ -558,6 +560,7 @@ where
|
||||||
impl<'me, Q> PanicGuard<'me, Q>
|
impl<'me, Q> PanicGuard<'me, Q>
|
||||||
where
|
where
|
||||||
Q: QueryFunction,
|
Q: QueryFunction,
|
||||||
|
Q::Value: Eq,
|
||||||
{
|
{
|
||||||
fn new(slot: &'me Slot<Q>, runtime: &'me Runtime) -> Self {
|
fn new(slot: &'me Slot<Q>, runtime: &'me Runtime) -> Self {
|
||||||
Self { slot, runtime }
|
Self { slot, runtime }
|
||||||
|
@ -616,6 +619,7 @@ Please report this bug to https://github.com/salsa-rs/salsa/issues."
|
||||||
impl<'me, Q> Drop for PanicGuard<'me, Q>
|
impl<'me, Q> Drop for PanicGuard<'me, Q>
|
||||||
where
|
where
|
||||||
Q: QueryFunction,
|
Q: QueryFunction,
|
||||||
|
Q::Value: Eq,
|
||||||
{
|
{
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if std::thread::panicking() {
|
if std::thread::panicking() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue