Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Incorrect CachedValue use" exception in RsFile #6127

Merged
merged 1 commit into from Sep 17, 2020
Merged

Conversation

vlad20012
Copy link
Member

The bug was introduced in #5690

Stacktrace
java.lang.Throwable: Incorrect CachedValue use: same CV with different captured context, this can cause unstable results and invalid PSI access.
Field this$0 in class org.rust.lang.core.psi.RsFile$declarations$1 has non-equivalent values:
FILE (org.rust.lang.core.psi.RsFile) and
FILE (org.rust.lang.core.psi.RsFile)
Either make `equals()` hold for these values, or avoid this dependency, e.g. by extracting CV provider into a static method.
  at com.intellij.openapi.diagnostic.Logger.error(Logger.java:143)
  at com.intellij.util.CachedValueStabilityChecker.complain(CachedValueStabilityChecker.java:163)
  at com.intellij.util.CachedValueStabilityChecker.checkFieldEquivalence(CachedValueStabilityChecker.java:130)
  at com.intellij.util.CachedValueStabilityChecker.checkFieldEquivalence(CachedValueStabilityChecker.java:126)
  at com.intellij.util.CachedValueStabilityChecker.checkProvidersEquivalent(CachedValueStabilityChecker.java:81)
  at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:71)
  at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:150)
  at org.rust.lang.core.psi.RsFile.getDeclarations(RsFile.kt:205)
  at org.rust.lang.core.psi.RsFile.getDeclaration(RsFile.kt:190)
  ...

bors r+

@vlad20012 vlad20012 added the fix Pull requests that fix some bug(s) label Sep 17, 2020
@vlad20012 vlad20012 added this to the v132 milestone Sep 17, 2020
@Undin
Copy link
Member

Undin commented Sep 17, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 17, 2020

Build succeeded:

@bors bors bot merged commit 876af4c into master Sep 17, 2020
@bors bors bot deleted the fix-cache-rsfile branch September 17, 2020 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants