-
Notifications
You must be signed in to change notification settings - Fork 598
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
Panic when a dependency is misconfigured. #6858
Conversation
Invalid crate dependency: Real { name: "bounded_int2", discriminator: Some("bounded_int") } Code quote: panic!(
"Invalid crate dependency: {:?}\nconfigured crates: {:#?}",
get_long_id(dep_crate_id),
configs.keys().cloned().map(get_long_id).collect_vec()
); |
Previously, ilyalesokhin-starkware wrote…
here is an example: Code snippet: Invalid crate dependency: Real { name: "bounded_int2", discriminator: Some("bounded_int") }
Configured crates: [
Real {
name: "core",
discriminator: None,
},
Real {
name: "stwo_cairo_verifier",
discriminator: Some(
"stwo_cairo_verifier",
),
},
Real {
name: "bounded_int2",
discriminator: Some(
"bounded_int2",
),
},
] |
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 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion
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 @ilyalesokhin-starkware)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 1289 at r1 (raw file):
"Invalid crate dependency: {:?}\nconfigured crates: {:#?}", get_long_id(dep_crate_id), configs.keys().cloned().map(get_long_id).collect_vec()
oh - we should probably just filter to the relevant crate without discriminator.
Code quote:
"Invalid crate dependency: {:?}\nconfigured crates: {:#?}",
get_long_id(dep_crate_id),
configs.keys().cloned().map(get_long_id).collect_vec()
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 @ilyalesokhin-starkware)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 1291 at r1 (raw file):
configs.keys().cloned().map(get_long_id).collect_vec() ); }
oh - we should probably just filter to the relevant crate without discriminator.
Suggestion:
panic!(
"Invalid crate dependency `{ident}: got discriminator {:?}\nconfigured discriminators: {:#?}",
dep.discriminator,
configs.keys().cloned().map(|crate_id|crate_id.lookup_intern(self.db).discriminator).collect_vec()
);
}
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 @ilyalesokhin-starkware)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 1291 at r1 (raw file):
Previously, orizi wrote…
oh - we should probably just filter to the relevant crate without discriminator.
i mean .filter_map(|crate_id| { let long_id = crate_id.lookup_intern(self.db); (long_id.name == ident).and_then(long_id.discriminator) })
Previously, orizi wrote…
The name could also be wrong. |
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
9aede37
to
7cf05a7
Compare
No description provided.