-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Better error message for trait bounds on structs. #15110
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
Note that this will not be an error much longer (trait bounds in struct declarations). |
Ah, in that case it's probably not worth going the distance to producing an example impl declaration. |
@nikomatsakis Niko, why will it not be an error much longer? |
This is now implemented, closing. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jul 17, 2023
internal: Add run-tests command This command is similar to `cargo test` except that it uses r-a to run tests instead of compiling and running them with rustc. This is slower than `cargo test` and it is only useful for me to see a bird view of what needs to be fixed. The current output is: ``` 48 passed, 5028 failed, 2 ignored All tests 174.74s, 648ginstr ``` 48 is very low, but higher than what I originally thought. Now that there is some passing tests, I can show the plan: https://github.com/rust-lang/rust-analyzer/assets/45197576/76d7d777-1843-4ca4-b7fe-e463bdade6cb That is, at the end, I want to be able to immediately re run every test after every change. (0.5s is not really immediate, but it's not finished yet, and it is way better than 8s that running a typical test in r-a will take on my system)
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was looking at this issue on SO:
https://stackoverflow.com/questions/24363369/polymorphism-in-rust
The reported error doesn't help much for someone who doesn't already know better:
The explanation in the first response is straight-forward: You need to refine that in the trait implementation, not the struct definition.
There's enough information present when someone tries to apply trait bounds in a struct to spit out the impl declaration line by way of example, so in this case (note R, Rules, and Board are all present in intelligible positions in the error report above):
The text was updated successfully, but these errors were encountered: