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

ICE when instance method calls static method #3707

Closed
burg opened this issue Oct 9, 2012 · 3 comments
Closed

ICE when instance method calls static method #3707

burg opened this issue Oct 9, 2012 · 3 comments
Labels
A-codegen Area: Code generation A-traits Area: Trait system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@burg
Copy link

burg commented Oct 9, 2012

This should not compile (AFAIK, but static methods aren't documented), but it shouldn't ICE either.

output

error: internal compiler error: calling transform_self_type_for_method on static method
rust: task failed at 'explicit failure', /Users/burg/repos/rust/src/libsyntax/diagnostic.rs:78
rust: task failed at 'explicit failure', /Users/burg/repos/rust/src/rustc/driver/rustc.rs:275
rust: domain main @0x7f8c0a800010 root task failed

testcase

struct Obj {
    member: uint
}

impl Obj {
    static pure fn boom() -> bool {
        return 1+1 == 2
    }
    pure fn chirp() {
        self.boom();
    }
}

fn main() {
    let o = Obj { member: 0 };
    o.chirp();
    1 + 1;
}
@catamorphism
Copy link
Contributor

Reproduced as of 1330b1c

catamorphism added a commit that referenced this issue Jan 3, 2013
@catamorphism
Copy link
Contributor

Reproduced as of eed2ca6

@brson
Copy link
Contributor

brson commented May 13, 2013

Fixed.

@brson brson closed this as completed May 13, 2013
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jul 4, 2024
Add syscall `dup()` for unix target

Add support for `dup()` and `dup2()`.

Fixes rust-lang#3454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-traits Area: Trait system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants