Skip to content
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

Check that the self type in an extern spec for a trait impl matches the external definition. #833

Open
nilehmann opened this issue Oct 1, 2024 · 0 comments
Labels
error-messages Better error messages good first issue Good for newcomers

Comments

@nilehmann
Copy link
Member

We currently accept nonsensical extern specs on trait implementations like this one

use flux_rs::*;

#[extern_spec(std::ops)]
impl<A: Step> Iterator for Range<usize> {}

Given the way we expand the macro, A won't be reported as non-constrained, and Range<usize> passes further validations because it is less generic than the extern implementation so it still implements Iterator. We should check that the self-type of extern specs for trait implementations matches the external definition.

@nilehmann nilehmann added good first issue Good for newcomers error-messages Better error messages labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-messages Better error messages good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant