-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE: Impl was matchable against Obligation(...) but now is not #22645
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
Labels
A-trait-system
Area: Trait system
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
Agree with @edwardw. Either way, this does still repro with: use std::ops::Add;
trait Scalar {}
impl Scalar for f64 {}
struct Bob;
impl<RHS: Scalar> Add <RHS> for Bob {
type Output = Bob;
fn add(self, rhs : RHS) -> Bob {} # this is not even valid
}
fn main() {
let b = Bob + 3.5;
// Internal compiler error (should be type error?):
b + 3
} |
This was referenced Apr 21, 2015
I think #23825 is also a dupe of this. The following code reproduces the same issue: fn main() {
let a: f32 = 0f32 * 0.0;
a * 0;
} Note that even though |
Duplicate of #24352 |
arielb1
pushed a commit
to arielb1/rust
that referenced
this issue
May 12, 2015
There is no subtyping relationship between the types (or their non-freshened variants), so they can not be merged. Fixes rust-lang#22645 Fixes rust-lang#24352 Fixes rust-lang#23825 Should fix rust-lang#25235 (no test in issue). Should fix rust-lang#19976 (test is outdated).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-trait-system
Area: Trait system
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
I got an internal compiler error when
cargo test
ing my code, and I was unfortunately unable to reproduce on a small sample. The code is here on Github, to reproduce the error, change the literal on one line in test from42.0
to42
.I am sorry for such a crude report, but I could not come with a better sample, as the origin of the error is a bit unclear to me.
The text was updated successfully, but these errors were encountered: