-
Notifications
You must be signed in to change notification settings - Fork 388
fix: trait where clause check fixes #9369
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
Merged
asterite
merged 6 commits into
master
from
ab/trait-where-clause-associated-type-constraint
Jul 31, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1a00723
fix: apply binings to full trait constraint when checking impl where …
asterite 48d64be
fix: remember replaced implicitly added named generics when checking …
asterite 92ac2f3
Reorder where clause so it's more likely to succeed
asterite 0e0aaeb
Simplify test code
asterite 3780300
Use `try_lookup_trait_implementation` so we don't actually apply bind…
asterite 76a61e5
Extract `desugar_generic_trait_bounds_and_reorder_where_clause`
asterite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...ccess_no_bug/noirc_frontend_tests_traits_trait_bound_constraining_two_generics/Nargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| [package] | ||
| name = "noirc_frontend_tests_traits_trait_bound_constraining_two_generics" | ||
| type = "bin" | ||
| authors = [""] | ||
|
|
||
| [dependencies] |
16 changes: 16 additions & 0 deletions
16
...cess_no_bug/noirc_frontend_tests_traits_trait_bound_constraining_two_generics/src/main.nr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
|
|
||
| pub trait Foo<U> {} | ||
|
|
||
| pub trait Baz<T, U> | ||
| where | ||
| T: Foo<U>, | ||
| {} | ||
|
|
||
| pub struct HasFoo1 {} | ||
| impl Foo<()> for HasFoo1 {} | ||
|
|
||
| pub struct HasBaz1 {} | ||
| impl Baz<HasFoo1, ()> for HasBaz1 {} | ||
|
|
||
| fn main() {} | ||
|
|
1 change: 1 addition & 0 deletions
1
...ess_no_bug/noirc_frontend_tests_traits_trait_bound_constraining_two_generics/src_hash.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 10102510944933110504 |
7 changes: 7 additions & 0 deletions
7
...tend_tests_traits_trait_where_clause_associated_type_constraint_expected_order/Nargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| [package] | ||
| name = "noirc_frontend_tests_traits_trait_where_clause_associated_type_constraint_expected_order" | ||
| type = "bin" | ||
| authors = [""] | ||
|
|
||
| [dependencies] |
26 changes: 26 additions & 0 deletions
26
...end_tests_traits_trait_where_clause_associated_type_constraint_expected_order/src/main.nr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
|
|
||
| pub trait BarTrait {} | ||
|
|
||
| pub trait Foo { | ||
| type Bar; | ||
| } | ||
|
|
||
| pub trait Baz<T> | ||
| where | ||
| T: Foo, | ||
| <T as Foo>::Bar: BarTrait, | ||
| {} | ||
|
|
||
| pub struct HasBarTrait1 {} | ||
| impl BarTrait for HasBarTrait1 {} | ||
|
|
||
| pub struct HasFoo1 {} | ||
| impl Foo for HasFoo1 { | ||
| type Bar = HasBarTrait1; | ||
| } | ||
|
|
||
| pub struct HasBaz1 {} | ||
| impl Baz<HasFoo1> for HasBaz1 {} | ||
|
|
||
| fn main() {} | ||
|
|
1 change: 1 addition & 0 deletions
1
...nd_tests_traits_trait_where_clause_associated_type_constraint_expected_order/src_hash.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 17365504020734663832 |
7 changes: 7 additions & 0 deletions
7
...nd_tests_traits_trait_where_clause_associated_type_constraint_unexpected_order/Nargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| [package] | ||
| name = "noirc_frontend_tests_traits_trait_where_clause_associated_type_constraint_unexpected_order" | ||
| type = "bin" | ||
| authors = [""] | ||
|
|
||
| [dependencies] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.