-
Notifications
You must be signed in to change notification settings - Fork 50
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
Int
ghost methods
#1281
Int
ghost methods
#1281
Conversation
Right now this bumps into limitations of the purity check, so #[pure]
fn add(x: Int, y: Int) -> Int {
x + y
} is rejected because the trait function |
Huh, you mean that we don't resolve trait methods in the purity check? We should! |
Hum nevermind, I just forgot a |
05351d4
to
d285d5a
Compare
"mul" | "add" | "sub" | "div" | "rem" | "neg" | "box_new" | "deref_method" | ||
| "deref_mut_method" => true, | ||
"box_new" | "deref_method" | "deref_mut_method" => true, |
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.
🎉
d285d5a
to
363d866
Compare
Overall, LGTM. @laurentder : this should fix your issues about machine arithmetics in pearlite specifications, since they are all rewritten. |
084a3da
to
d944e6e
Compare
Allow using operators (
+
,*
...) onInt
in ghost code.This works because it is never possible to get an
Int
in normal (non-ghost) code.Fixes #1271.