-
Notifications
You must be signed in to change notification settings - Fork 50
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
Creusot rejects these generic definitions with trait constraints #1285
Comments
I'm trying to define traits that gather the necessary constraints, e.g.,
However the constraint on the associated type doesn't seem to work
UPDATE: found a variant that works trait MyOrd
where
Self: Ord + DeepModel<DeepModelTy: OrdLogic>,
{}
pub fn min<A: MyOrd>(x: A) {
} The previous variant seems to rely on an unimplemented feature of trait resolution.
|
I think the issue here is that |
How does it do that? the only way I can think of is to somehow shadow traits from |
we have |
I think it does that, but this fails, because it cannot find the bound because of rust-lang/rust#44491. |
Cannot this be written: trait MyOrd: Ord + DeepModel<DeepModelTy: OrdLogic>,
{} |
These are definitions which compile with plain
rustc
, but notcreusot
:Error message:
(Adding a
#[invariant(true)]
doesn't help)Error message:
The text was updated successfully, but these errors were encountered: