-
Notifications
You must be signed in to change notification settings - Fork 583
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
added validations for traitItemInfo #7237
Conversation
84d0cba
to
69924d3
Compare
There was a problem hiding this 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 5 files reviewed, 1 unresolved discussion
a discussion (no related file):
Note that support for impl will be submitted in a different PR.
4ed5709
to
3ba357a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r2, 1 of 3 files at r3.
Reviewable status: 1 of 7 files reviewed, 4 unresolved discussions (waiting on @gilbens-starkware)
crates/cairo-lang-semantic/src/items/feature_kind.rs
line 78 at r2 (raw file):
/// Returns the `FeatureKind` associated with the implementing struct. fn get_feature_kind(&self) -> FeatureKind; }
Suggestion:
/// A trait for retrieving the `FeatureKind` of an item.
pub trait HasFeatureKind {
/// Returns the `FeatureKind` associated with the implementing struct.
fn feature_kind(&self) -> FeatureKind;
}
crates/cairo-lang-semantic/src/expr/compute.rs
line 2846 at r2 (raw file):
}; let func_name = segment.identifier(syntax_db); let generic_args_syntax: Option<Vec<ast::GenericArg>> = segment.generic_args(syntax_db);
revert
crates/cairo-lang-semantic/src/expr/compute.rs
line 2896 at r2 (raw file):
)?; // Validate if the function is usable before inserting it into `used_items`.
useless doc - especially the second part.re
Code quote:
// Validate if the function is usable before inserting it into `used_items`.
3ba357a
to
418827c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 7 files reviewed, 4 unresolved discussions (waiting on @gilbens-starkware and @orizi)
crates/cairo-lang-semantic/src/expr/compute.rs
line 2846 at r2 (raw file):
Previously, orizi wrote…
revert
Done.
crates/cairo-lang-semantic/src/expr/compute.rs
line 2896 at r2 (raw file):
Previously, orizi wrote…
useless doc - especially the second part.re
Done.
crates/cairo-lang-semantic/src/items/feature_kind.rs
line 78 at r2 (raw file):
/// Returns the `FeatureKind` associated with the implementing struct. fn get_feature_kind(&self) -> FeatureKind; }
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r3, 5 of 7 files at r4, all commit messages.
Reviewable status: 7 of 9 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware)
crates/cairo-lang-semantic/src/items/module.rs
line 291 at r4 (raw file):
impl HasFeatureKind for ModuleItemInfo { fn feature_kind(&self) -> FeatureKind { self.feature_kind.clone()
if requires a clone - possibly just return a & instead.
Code quote:
self.feature_kind.clone()
418827c
to
ac9f2d2
Compare
There was a problem hiding this 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 9 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @orizi)
crates/cairo-lang-semantic/src/items/module.rs
line 291 at r4 (raw file):
Previously, orizi wrote…
if requires a clone - possibly just return a & instead.
Done.
ac9f2d2
to
fc0271e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r5, all commit messages.
Reviewable status: 8 of 10 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 1749 at r5 (raw file):
/// configuration. If the item uses an unstable, deprecated, or internal feature /// that is not permitted, a corresponding diagnostic error is reported. pub fn validate_item_usability<T: HasFeatureKind>(
This is the wrong name now - it only checks features
fc0271e
to
effa77e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 8 of 10 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @orizi)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 1749 at r5 (raw file):
Previously, orizi wrote…
This is the wrong name now - it only checks features
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 4 files at r5, 2 of 2 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r3, 3 of 4 files at r5, 1 of 2 files at r6, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @orizi)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 851 at r6 (raw file):
}; if let Ok(trait_definition_data) = self.db.priv_trait_definition_data(concrete_trait_id.trait_id(self.db))
Don't call directly to the priv_trait_definition_data
, add another query trait_item_info_by_name
query.
Code quote:
self.db.priv_trait_definition_data
effa77e
to
990151a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @orizi)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 851 at r6 (raw file):
Previously, gilbens-starkware (Gil Ben-Shachar) wrote…
Don't call directly to the
priv_trait_definition_data
, add another querytrait_item_info_by_name
query.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r7, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 7 files at r4, 1 of 4 files at r5, 3 of 3 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)
990151a
to
5a00d55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)
No description provided.