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

Coherence does not properly handle VtableObject impls #23323

Closed
arielb1 opened this issue Mar 12, 2015 · 2 comments
Closed

Coherence does not properly handle VtableObject impls #23323

arielb1 opened this issue Mar 12, 2015 · 2 comments
Labels
A-type-system Area: Type system

Comments

@arielb1
Copy link
Contributor

arielb1 commented Mar 12, 2015

Directly having an impl Trait for Trait and cause a "coherence failed to report ambiguity" ICE. Having an indirect impl (impl<T: ?Sized> Trait for T) causes cryptic "type annotations required: cannot resolve Bar : Bar" and "recursion limit exceeded during monomorphisation" errors, but I didn't manage to get an ICE.

An example that causes a coherence failed to report ambiguity ICE:

trait Bar { fn bar(&self); }

impl Bar for Bar {
    fn bar(&self) { println!("trait-object impl called"); }
}

impl Bar for () {
    fn bar(&self) { println!("unit impl called"); }
}

fn main() {
}
@arielb1
Copy link
Contributor Author

arielb1 commented Mar 12, 2015

This is kind-of related to #18737, but not really (that one had a confusing issue with <Box<Any> as Any>, but this is a problem with <Any as Any>)

@steveklabnik steveklabnik added the A-type-system Area: Type system label Mar 19, 2015
@arielb1
Copy link
Contributor Author

arielb1 commented May 16, 2015

This is fixed.

@arielb1 arielb1 closed this as completed May 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

2 participants