-
Notifications
You must be signed in to change notification settings - Fork 575
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
chore: remove all instances of inline(always) from corelib #6114
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 25 of 25 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @javra)
corelib/src/option.cairo
line 56 at r1 (raw file):
fn unwrap(self: Option<T>) -> T { self.expect('Option::unwrap failed.') }
these are a must - without your builds would crash.
Suggestion:
#[inline(never)]
fn expect(self: Option<T>, err: felt252) -> T {
match self {
Option::Some(x) => x,
Option::None => core::panic_with_felt252(err),
}
}
#[inline(never)]
fn unwrap(self: Option<T>) -> T {
self.expect('Option::unwrap failed.')
}
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 @javra)
a discussion (no related file):
@ilyalesokhin-starkware for 2nd eye.
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 @orizi)
corelib/src/option.cairo
line 56 at r1 (raw file):
Previously, orizi wrote…
these are a must - without your builds would crash.
Did you mean to add never
? They were inline(always)
before.
What's special about unwrap
and expect
in terms of inlining? You already mentioned it on the other PR and I tested it on a small example which didn't crash.
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 @javra)
corelib/src/option.cairo
line 56 at r1 (raw file):
Previously, javra (Jakob von Raumer) wrote…
Did you mean to add
never
? They wereinline(always)
before.What's special about
unwrap
andexpect
in terms of inlining? You already mentioned it on the other PR and I tested it on a small example which didn't crash.
i meant always
- sorry.
it is required due to code doing withdraw_gas().unwrap()
(or expect).
if it isn't inlined - gas variables won't be able to properly be solved.
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: 24 of 25 files reviewed, 2 unresolved discussions (waiting on @orizi)
corelib/src/option.cairo
line 56 at r1 (raw file):
Previously, orizi wrote…
i meant
always
- sorry.it is required due to code doing
withdraw_gas().unwrap()
(or expect).
if it isn't inlined - gas variables won't be able to properly be solved.
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 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @javra)
Can we move this forward before it rots more than it already has? 😅 cc @orizi |
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:
complete! all files reviewed, all discussions resolved (waiting on @javra)
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.
yes - sorry - unblocking - rebase and i'll merge.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @javra)
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.
done 👍
Reviewable status: 1 of 25 files reviewed, all discussions resolved (waiting on @orizi)
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 24 of 24 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @javra)
As suggested by @orizi in the discussion to PR #5911.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)