Skip to content

Internal compiler error casting to trait type twice #3689

Closed

Description

@ben0x539

I accidentally had something like stdout() as io::Writer and got an ICE, but it also happens with trivial traits/trait impls like this:

trait Foo {}
impl (): Foo {}

fn main() {
    let _a = () as Foo as Foo;
}

rustc just errors out with an unexpected failure, and says

rust: task failed at 'get_vtable: expected a static origin', /home/ben/code/repos/rust/src/rustc/middle/trans/meth.rs:507

Activity

  1. jbclements commented on Feb 5, 2013

    @jbclements
    Contributor

    Looks like I just ran into this too...

  2. catamorphism commented on Feb 21, 2013

    @catamorphism
    Contributor

    Bumping to 0.7

  3. ben0x539 commented on Mar 22, 2013

    @ben0x539
    ContributorAuthor

    Can't reproduce this anymore. Maybe it went away when sigils started being required for object-boxing?

  4. added a commit that references this issue on May 15, 2021
  5. added 2 commits that reference this issue on May 21, 2022
    6ff77b9
    5dad517
  6. added a commit that references this issue on Jun 29, 2024
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-trait-systemArea: Trait systemI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions