Skip to content

explicit self and object types (trait types) are incompatible #3865

Closed
@nikomatsakis

Description

@nikomatsakis
Contributor

This program yields an LLVM error:

trait Foo {
    fn foo(&self) -> uint;
}

impl uint: Foo {
    fn foo(&self) -> uint { *self }
}

fn bar(x: @Foo, v: uint) {
    assert x.foo() == v;
}

fn main() {
    let x: @uint = @3;
    bar(x as @Foo, *x);
}

Activity

nikomatsakis

nikomatsakis commented on Dec 4, 2012

@nikomatsakis
ContributorAuthor

Fixed.

added a commit that references this issue on Sep 8, 2024

Auto merge of rust-lang#3865 - Mandragorian:doc_fixes_pthreads, r=Ral…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nikomatsakis

        Issue actions

          explicit self and object types (trait types) are incompatible · Issue #3865 · rust-lang/rust