Closed haskelladdict closed 9 years ago
Minified:
fn main() {
1.0f64 - 1.0;
1.0f64 - 1;
}
Seems like the trait cache is broken.
Well it's not just the trait-cache:
DEBUG:rustc::middle::traits::select: CACHE MISS: cache_fresh_trait_pred=Binder(TraitPredicate(<f64 as Sub<FreshIntTy(0)>>)), candidate=ImplCandidate(DefId { krate: 0, node: 18 }:f64.Sub
How can <f64 as Sub<FreshIntTy(0)>>
~ f64.Sub<f64>
?
The problem here is that freshen turns both IntVid
and FloatVid
into FreshIntTy
, but there is no subtyping relationship between them.
The simplified code below results in an ICE using the following rust version
rustc 1.0.0-beta (9854143cb 2015-04-02) (built 2015-04-02) binary: rustc commit-hash: 9854143cba679834bc4ef932858cd5303f015a0e commit-date: 2015-04-02 build-date: 2015-04-02 host: x86_64-apple-darwin release: 1.0.0-beta
---- CODE resulting in ICE -------
The issue appears to be the second to last line. The compiler should reject (k-1). Changing this to
results in proper compilation. Also, removing the previous scope of the for loop works and the compiler then properly complains about the (k-1) bit. Below is the backtrace:
----- BACKTRACE ----