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

XCrate typedef of trait makes ICE #3907

Closed
brson opened this issue Nov 2, 2012 · 5 comments
Closed

XCrate typedef of trait makes ICE #3907

brson opened this issue Nov 2, 2012 · 5 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries A-trait-system Area: Trait system E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@brson
Copy link
Contributor

brson commented Nov 2, 2012

aux trait_typedef_cc.rs:

pub trait Foo {
    fn bar();
}

trait-typedef-cc.rs:

// aux-build:trait_typedef_cc.rs
extern mod trait_typedef_cc;

type Foo = trait_typedef_cc::Foo;

struct S {
    name: int
}

impl S: Foo {
    fn bar() { }
}

fn main() {
    let s = S {
        name: 0
    };
    s.bar();
}

ICE:

rust: task failed at 'Assertion id.crate != ast::local_crate failed', /home/brian/dev/rust/src/rustc/middle/ty.rs:3508
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x5d)[0x2afcd6d9a10d]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt.so(+0x3090d)[0x2afcd6db090d]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt.so(upcall_fail+0x1a8)[0x2afcd6d9c838]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/libcore-c3ca5d77d81b46c1-0.5.so(_ZN2rt6rustrt16rust_upcall_fail17_74a64c4360d2dcec3_05E+0x37)[0x2afcd4df6497]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/libcore-c3ca5d77d81b46c1-0.5.so(_ZN2rt8rt_fail_17_74a64c4360d2dcec3_05E+0x67)[0x2afcd4d15967]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-c84825241471686d-0.5.so(_ZN6middle2ty13trait_methods16_6522d932c2318273_05E+0x118)[0x2afcd6052058]

brson added a commit that referenced this issue Nov 2, 2012
@catamorphism
Copy link
Contributor

Reproduced as of 737e115

@ghost ghost assigned catamorphism Feb 21, 2013
@catamorphism
Copy link
Contributor

Still ICEs as of 373504, but not critical. De-milestoning

@catamorphism
Copy link
Contributor

This yields a proper resolve error message now rather than an ICE, but it still doesn't work. Nominating for milestone 5, production-ready

@graydon
Copy link
Contributor

graydon commented Jul 18, 2013

working as designed now, type is not trait

@catamorphism
Copy link
Contributor

Behavior is correct, but we should add both in-crate and out-of-crate tests.

bors added a commit that referenced this issue Aug 15, 2013
Closes #3907
Closes #5493
Closes #4464
Closes #4759
Closes #5666
Closes #5884
Closes #5926
Closes #6318
Closes #6557
Closes #6898
Closes #6919
Closes #7222
RalfJung pushed a commit to RalfJung/rust that referenced this issue Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-trait-system Area: Trait system E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants