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

Implementation cannot be defined for 'type' alias #13551

Closed
araujol opened this issue Apr 16, 2014 · 2 comments
Closed

Implementation cannot be defined for 'type' alias #13551

araujol opened this issue Apr 16, 2014 · 2 comments
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically

Comments

@araujol
Copy link

araujol commented Apr 16, 2014

Code example:

Save this in main.rs and try to compile.

enum T {}
type New = T;

impl New {}

fn main() {}

Trying to compile, it shows this error:

impl.rs:4:1: 4:12 error: cannot associate methods with a type outside the crate the type is defined in; define and implement a trait or new type instead
impl.rs:4 impl New {}
^~~~~~~~~~~
error: aborting due to previous error

Using git master HEAD: 6fcf43e

@klutzy
Copy link
Contributor

klutzy commented Apr 16, 2014

dup of #9767?

@ghost ghost self-assigned this Nov 7, 2014
@steveklabnik
Copy link
Member

Yes, this is a duplicate of that issue.

flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

No branches or pull requests

4 participants