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

Fix allowed features for generic param resolving. #5888

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

gilbens-starkware
Copy link
Contributor

@gilbens-starkware gilbens-starkware commented Jun 25, 2024

Stack:

⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.


This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware)

a discussion (no related file):
add previously failing test.



crates/cairo-lang-defs/src/ids.rs line 320 at r1 (raw file):

impl ModuleItemId {
    pub fn as_syntax_node(&self, db: &dyn DefsGroup) -> SyntaxNode {

could you have just called stable_ptr from the outside?

Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @orizi)

a discussion (no related file):

Previously, orizi wrote…

add previously failing test.

Done.



crates/cairo-lang-defs/src/ids.rs line 320 at r1 (raw file):

Previously, orizi wrote…

could you have just called stable_ptr from the outside?

No, just untyped_stable_ptr and then if we want to convert it to typed one we'll have to do something similar to this.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware)


crates/cairo-lang-defs/src/ids.rs line 320 at r1 (raw file):

Previously, gilbens-starkware (Gil Ben-Shachar) wrote…

No, just untyped_stable_ptr and then if we want to convert it to typed one we'll have to do something similar to this.

but you don't need it type now - do you?


crates/cairo-lang-semantic/src/diagnostic_test_data/tests line 592 at r2 (raw file):

error: The name `BadATraitImpl` is defined multiple times.
 --> lib.cairo:45:6
impl BadATraitImpl<+UnstableTrait> of ATrait;

remove diag

Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @orizi)


crates/cairo-lang-defs/src/ids.rs line 320 at r1 (raw file):

Previously, orizi wrote…

but you don't need it type now - do you?

I do, not all syntax kind implement QueryAttrs.


crates/cairo-lang-semantic/src/diagnostic_test_data/tests line 592 at r2 (raw file):

Previously, orizi wrote…

remove diag

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware)


crates/cairo-lang-semantic/src/items/generics.rs line 296 at r3 (raw file):

    resolver.set_allowed_features(
        &lookup_item,
        &lookup_item.as_syntax_node(db.upcast()),

and remove all the rest.

also - consider just using this inside the set_allowed_features function.
but probably not for this PR.

Suggestion:

        &lookup_item.untyped_stable_ptr(db.upcast()).lookup(db)

Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @orizi)


crates/cairo-lang-semantic/src/items/generics.rs line 296 at r3 (raw file):

Previously, orizi wrote…

and remove all the rest.

also - consider just using this inside the set_allowed_features function.
but probably not for this PR.

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware)

@gilbens-starkware gilbens-starkware added this pull request to the merge queue Jun 27, 2024
Merged via the queue into main with commit 2d7f903 Jun 27, 2024
43 of 44 checks passed
@orizi orizi deleted the spr/main/36ae2d69 branch July 1, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants