Skip to content

monomorphization fails with generic methods on impls #1944

Closed
@nikomatsakis

Description

@nikomatsakis

This test case:

impl foo for uint {
    fn with<A:copy>(a: A) -> (uint, A) {
        (self, a)
    }
}

fn main() {
    let pair = 3u.with("hi");
    assert pair == (3u, "hi");
}

yields an assertion failure:

rust: upcall fail 'Assertion did.crate != ast::local_crate failed', ../src/rustc/middle/ty.rs:2294

@pcwalton I believe this is why the --monomorphize'd version of rustc did not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions