Skip to content

clippy reports unused imports when using both requires and ensures #9

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

Open
robjtede opened this issue May 2, 2025 · 1 comment
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@robjtede
Copy link
Member

robjtede commented May 2, 2025

see https://gitlab.com/karroffel/contracts/-/issues/18

@robjtede
Copy link
Member Author

robjtede commented May 2, 2025

The thing about this one is that any combination of attributes are inextricably linked because the code they generate is not strictly additive. Each attribute does a scan for the other attributes.

Making this more intitive for users would require a change of syntax that uses a single attribute. E.g.,

#[contract(
  requires( n != T::zero() || d != T::zero() )],
  ensures( ret != T::zero() && n % ret == T::zero() && d % ret == T::zero()),
)]
pub fn euclidean<T>(n: T, d: T) -> T

@robjtede robjtede added enhancement New feature or request good first issue Good for newcomers labels May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant