-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Extra trait bound makes function body fail to typecheck #82219
Comments
@rustbot label: +A-traits |
theres a zulip topic in wg-traits about this here |
I'm on error: implementation of `sqlx::Decode` is not general enough
--> src/models.rs:183:5
|
183 | Decode,
| ^^^^^^ implementation of `sqlx::Decode` is not general enough
|
= note: `std::string::String` must implement `sqlx::Decode<'0, sqlx::Postgres>`, for some specific lifetime `'0`...
= note: ...but it actually implements `sqlx::Decode<'r, sqlx::Postgres>`
= note: this error originates in the derive macro `Decode` (in Nightly builds, run with -Z macro-backtrace for more info) |
Is there a way to close this? This is very huge. |
It's been 3 years and this issue is still occurring on 1.76.0. Not even higher-ranked trait bounds fixes this; applying them causes another set of errors, and after correcting them, that ultimately leads right back to this one. |
I suspect we will never fix this and it should be closed as wontfix, the FCP in #119820 means that we never intend to consider the region constraint In theory (under the new solver) the proof tree for the issue description should look somewhat like:
Both of these candidates will have results of Going to just copy the thing we did with #121602 and do an fcp to close this incase anyone on t-types thinks there's a reasonable way to support this that does not involve going back on our decision in #119820. (as a sidenote the bump on this thread is hilarious timing as I intended to write this fcp close comment once I got back from rust nation but had not gotten the chance to find this issue again so the notification was perfect for saving me time doing that lol) |
Team member @BoxyUwU has proposed to close this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
We should keep this issue open for improving the diagnostics (or open a new one) Also not sure whether we have a test. Should add one, too |
This could get theoretically fixed by switching to an entirely eager approach to region unification/constraints. I don't expect that to happen any time soon (next ~5 years) so I believe |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
I came across a seemingly related issue with many many more linked issues yesterday: #24066 (via this blog post: https://veera.app/trait_selection_bug.html) |
The final comment period, with a disposition to close, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
I tried this code (playground):
Or with references instead of Option
I expected to see this happen: Compile successfully, with or without the unneeded
(): Foo<'a>
bound.Instead, this happened: It works when the
(): Foo<'a>
bound is removed, but as written it produces:Meta
rustc --version --verbose
:Also happens on Nightly.
The text was updated successfully, but these errors were encountered: