-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
False negative for "the trait bound K: Ord is not satisfied" #88244
Copy link
Copy link
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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: Ordis not satisfied.But
K: ProtoandProto: OrdthereforeK: Ord.The code also fails if I explicitly add the
K: Ordtrait bound to the impl.Meta
I tried using the most recent nightly on macOS 11.3 (Big Sur) and on the playground.