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

Support feature at module and fn level. #4941

Merged
merged 1 commit into from
Jan 28, 2024
Merged

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Jan 28, 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

@orizi orizi force-pushed the pr/orizi/release-prep/22ee9464 branch from 67d52bb to bf45849 Compare January 28, 2024 11:50
@orizi orizi force-pushed the pr/orizi/release-prep/22ee9464 branch from bf45849 to e8c431d Compare January 28, 2024 12:24
@orizi orizi mentioned this pull request Jan 28, 2024
Copy link
Contributor

@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.

Reviewed 7 of 8 files at r1, all commit messages.
Reviewable status: 7 of 8 files reviewed, 2 unresolved discussions (waiting on @orizi)


crates/cairo-lang-semantic/src/expr/compute.rs line 268 at r1 (raw file):

                diagnostics,
            ),
        };

Consider implementing QueryAttrs for LookupItemId and then just extract_allowed_features it.

Code quote:

        let allowed_features = match lookup_item_id {
            LookupItemId::ModuleItem(id) => extract_allowed_features(
                semantic_db,
                &id.stable_location(defs_db).syntax_node(defs_db),
                diagnostics,
            ),
            LookupItemId::TraitItem(id) => extract_allowed_features(
                semantic_db,
                &id.stable_location(defs_db).syntax_node(defs_db),
                diagnostics,
            ),
            LookupItemId::ImplItem(id) => extract_allowed_features(
                semantic_db,
                &id.stable_location(defs_db).syntax_node(defs_db),
                diagnostics,
            ),
        };

crates/cairo-lang-semantic/src/expr/compute.rs line 2507 at r1 (raw file):

}

/// Returns the allowed features of a query

Suggestion:

an object which supports attributes.

@orizi orizi force-pushed the pr/orizi/release-prep/22ee9464 branch from e8c431d to 0dda952 Compare January 28, 2024 12:58
Copy link
Collaborator Author

@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: 7 of 8 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware)


crates/cairo-lang-semantic/src/expr/compute.rs line 268 at r1 (raw file):

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

Consider implementing QueryAttrs for LookupItemId and then just extract_allowed_features it.

can't - trait is defined on syntax, and ids are defined on defs.


crates/cairo-lang-semantic/src/expr/compute.rs line 2507 at r1 (raw file):

}

/// Returns the allowed features of a query

Done.

Copy link
Contributor

@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.

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @orizi)

@orizi orizi added this pull request to the merge queue Jan 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 28, 2024
@orizi orizi added this pull request to the merge queue Jan 28, 2024
@orizi orizi removed this pull request from the merge queue due to a manual request Jan 28, 2024
@orizi orizi added this pull request to the merge queue Jan 28, 2024
Merged via the queue into main with commit feb1690 Jan 28, 2024
83 checks passed
@orizi orizi deleted the pr/orizi/release-prep/22ee9464 branch February 4, 2024 08:34
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.

2 participants