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

Seg-fault when not providing associated type #20712

Closed
engstad opened this issue Jan 7, 2015 · 2 comments
Closed

Seg-fault when not providing associated type #20712

engstad opened this issue Jan 7, 2015 · 2 comments
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@engstad
Copy link

engstad commented Jan 7, 2015

This code:

#![feature(globs)]
use std::ops::Add;
struct MyInt { a : int }
impl Add for MyInt {
    fn add(self, rhs:Self) -> Self { MyInt { a : self.a + rhs.a } }
}

fn main(){}

Causes seg-fault:

<anon>:7:1: 9:2 error: internal compiler error: impl `VtableImpl(impl_def_id=DefId { krate: 0, node: 10 }:MyInt.Add, substs=Substs[types=[[];[];[]], regions=[[];[];[]]], nested=[[];[];[]])` did not contain projection for `Obligation(predicate=<MyInt as TraitRef(MyInt, core::ops::Add)>::Output,depth=0)`
<anon>:7 impl Add for MyInt {
<anon>:8     fn add(self, rhs:Self) -> Self { MyInt { a : self.a + rhs.a } }
<anon>:9 }
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:123

See http://is.gd/1lKWYa

@nrc nrc added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-associated-items Area: Associated items (types, constants & functions) labels Jan 8, 2015
@nikomatsakis
Copy link
Contributor

I think this is a dup of #20371, which has been fixed. Certainly the example no longer reproduces and the error message is the same.

@nikomatsakis
Copy link
Contributor

(Feel free to re-open if you can still reproduce this on a recent build.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants