-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
unstable fingerprints for optimized_mir #80336
Comments
@KalitaAlexey Can you please try with a recent nightly and see if it works? E.g. try with 2020-12-22. |
|
This looks like a legitimate issue with
On the second (modified incremental) run, we get this result:
The return value of |
The issue is caused by the way that we handle regions in the evaluation cache. When we insert a result into the evaluation cache (either Unfortunately, this can lead to issues if we try to evaluate the following two predicates: impl SomeTrait for SomeType<'static>
SomeType<'static> as SomeTrait
SomeType<'#_r> as SomeTrait When we evaluate If we later try to evaluate This is really difficult to observe in practice, for a number of reasons:
As a result, I haven't been able to minimize this. |
Assigning |
@rustbot ping cleanup might be interesting to follow up on the great |
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good cc @AminArria @camelid @chrissimpkins @contrun @DutchGhost @elshize @ethanboxx @h-michael @HallerPatrick @hdhoang @hellow554 @imtsuki @JamesPatrickGill @kanru @KarlK90 @LeSeulArtichaut @MAdrianMattocks @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @shekohex @sinato @smmalis37 @steffahn @Stupremee @tamuhey @turboladen @woshilapin @yerke |
I was able to reproduce this on in the rust analyzer repo:
I am able to reproduce on edit: also reproduces with 1.47 and 1.46 |
Adjusted the labels and title according to Aaron's analysis, the big question regarding this issue being:
|
Much smaller repro: git clone https://github.com/rust-lang/regex/
cd regex
git checkout fc3e6aa
RUSTFLAGS="-Zincremental-verify-ich=yes" cargo build
git checkout 0e96af4
RUSTFLAGS="-Zincremental-verify-ich=yes" cargo build
|
With the sample above, I can reproduce the ICE by inserting an empty line in the project inside diff --git a/src/vector/avx2.rs b/src/vector/avx2.rs
index 5228c60..b7d10d5 100644
--- a/src/vector/avx2.rs
+++ b/src/vector/avx2.rs
@@ -12,6 +12,7 @@ impl AVX2VectorBuilder {
if is_x86_feature_detected!("avx2") {
Some(AVX2VectorBuilder(()))
} else {
+
None
}
} |
reduced as #![allow(dead_code)]
use std::arch::x86_64::*;
pub struct AVX2VectorBuilder(());
impl AVX2VectorBuilder {
pub fn new() -> Option<AVX2VectorBuilder> {
if is_x86_feature_detected!("avx2") {
Some(AVX2VectorBuilder(()))
} else {
None
}
}
}
#[repr(transparent)]
pub struct A {
a: i32
} adding empty lines to this file will cause the ICE |
Reduced even further pub fn f() {
let _ = is_x86_feature_detected!("avx2");
} |
It looks like there are actually two different issues going on here. The original issue is a bug with caching in The other is a bug that shows up as a changed |
Let's continue the discussion of the trait evaluation issue in #80691 |
…eywiser Properly handle `SyntaxContext` of dummy spans in incr comp Fixes rust-lang#80336 Due to macro expansion, we may end up with spans with an invalid location and non-root `SyntaxContext`. This commits preserves the `SyntaxContext` of such spans in the incremental cache, and ensures that we always hash the `SyntaxContext` when computing the `Fingerprint` of a `Span` Previously, we would discard the `SyntaxContext` during serialization to the incremental cache, causing the span's `Fingerprint` to change across compilation sessions.
cpuinfo:
|
Code
Steps
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: