-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Cannot implement simple trait #15316
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
Comments
What makes you think it shouldn't?
This is actually indicative of the trait needing to be imported, not just referenced (as you did in the |
Because MyApp has (supposedly) a pure abstract method.
If the trait needs to be imported (very weird), the compiler should complain instead of acting like everything's fine and just ignoring the trait implementation... |
Closing as intended behavior. If you'd like to open an issue about improving the error message, please feel free to! |
Pass `TraitEnvironment` into `layout_ty` and `const_eval` We need to do either this or get rid of trait environment in `normalize_ty`. Let's go with this for now.
I've got a simple trait that isn't being implemented somehow, and that compiles fine even though it shouldn't:
MyProject/MyFramework/base.rs
MyProject/MyFramework/mod.rs
MyProject/MyApp/main.rs
This compiles fine even though it shouldn't.
If I put the trait declaration inside the main.rs file, the compiler outputs the proper error, as expected.
Also, if I create an instance of MyApp inside main() and try to call Run() it says the type doesn't have that method, which I believe is because the trait isn't being implemented at all, hence no errors compiling...
I'm sorry if I should be more descriptive, but this is my first time trying rust and I don't know what else is important.
[edit]
I compiled rust from git, revision ff94f86.
The text was updated successfully, but these errors were encountered: