-
Notifications
You must be signed in to change notification settings - Fork 505
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
Updating the Diagnostics Pointer in wrong type for contract. #6849
base: main
Are you sure you want to change the base?
Conversation
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 r1, all commit messages.
Reviewable status: 1 of 4 files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware and @Tomer-StarkWare)
crates/cairo-lang-starknet/src/analyzer.rs
line 84 at r1 (raw file):
err.location(db) .unwrap_or_else(|| contract.submodule_id.stable_ptr(db.upcast()).untyped()), format!("Failed to generate ABI: {err}"),
if you were supplied with location - you should still use it.
Code quote:
err.location(db)
.unwrap_or_else(|| contract.submodule_id.stable_ptr(db.upcast()).untyped()),
format!("Failed to generate ABI: {err}"),
crates/cairo-lang-starknet/src/plugin/plugin_test_data/contracts/interfaces
line 1729 at r1 (raw file):
warning: Plugin diagnostic: Failed to generate ABI: Duplicate entry point: 'foo'. This is not currently supported. --> lib.cairo:56:5 #[abi(embed_v0)]
this is definitely a degregation.
crates/cairo-lang-starknet/src/analyzer.rs
line 88 at r1 (raw file):
break; } }
Suggestion:
let mut contract_stable_ptr = if let Some(attr) = contract.module_id().find_attr(db, CONTRACT_ATTR) {
attr.stable_ptr.untyped()
} else {
contract.submodule_id.stable_ptr(db.upcast()).untyped()
};
19a9b1c
to
2e14e22
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 4 files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware and @orizi)
crates/cairo-lang-starknet/src/analyzer.rs
line 84 at r1 (raw file):
Previously, orizi wrote…
if you were supplied with location - you should still use it.
Done.
crates/cairo-lang-starknet/src/plugin/plugin_test_data/contracts/interfaces
line 1729 at r1 (raw file):
Previously, orizi wrote…
this is definitely a degregation.
Done.
crates/cairo-lang-starknet/src/analyzer.rs
line 88 at r1 (raw file):
break; } }
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 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @Tomer-StarkWare)
a discussion (no related file):
do you have any example that is still mapped to full contract?
(As this didn't change any diags)
crates/cairo-lang-starknet/src/analyzer.rs
line 91 at r2 (raw file):
err.location(db).unwrap_or(contract_stable_ptr), format!("Failed to generate ABI: {err}"), ));
Suggestion:
let location = err.location(db).unwrap_or_else(
|| if let Ok(Some(attr)) = contract.module_id().find_attr(db, CONTRACT_ATTR) {
attr.stable_ptr.untyped()
} else {
contract.submodule_id.stable_ptr(db.upcast()).untyped()
});
diagnostics.push(PluginDiagnostic::warning(
location, format!("Failed to generate ABI: {err}")
));
No description provided.