-
Notifications
You must be signed in to change notification settings - Fork 13.3k
False negative for "the trait bound K: Ord
is not satisfied"
#88244
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I should add that this used to compile. I noticed the error after updating my compiler. I did not record the old version number, but it was very old. Maybe 1.51 or so. |
The code example will (most likely) compile again once #88040 is merged. However the underlying issue isn’t addressed; that PR just removes the |
searched nightlies: from nightly-2021-08-14 to nightly-2021-08-22 bisected with cargo-bisect-rustc v0.6.0Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --access github --regress error |
I’m not sure I quite understand the description of #87375 Is the code in this issue working as intended or is this a bug? |
Okay, if I understand this correctly, there’s currently a |
@rustbot label A-associated-items, requires-nightly |
So #88328 just got merged, and that means instead of inferring bounds on const fns to be |
I can confirm this works again in the playground. |
I tried this code:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=77d9f2d244245a27faedba8a04c6ca14
I expected it to compile.
Instead I get the error:
It complains that
K: Ord
is not satisfied.But
K: Proto
andProto: Ord
thereforeK: Ord
.The code also fails if I explicitly add the
K: Ord
trait bound to the impl.Meta
I tried using the most recent nightly on macOS 11.3 (Big Sur) and on the playground.
The text was updated successfully, but these errors were encountered: