-
Notifications
You must be signed in to change notification settings - Fork 4
Hotfix pass singleton tuples as single elements to closures #815
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
Changes from all commits
244dae6
d3da569
a90733e
932c25a
1547f68
14a9f97
c6fb79a
719e56d
8860238
4b9222e
83bf058
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, just think it's a little bit annoying of these file changes (
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with you @Stevengre and I raised it before and @ehildenb and @jberthold convinced my it was safer to have a dump some intermediate state to compare against. It isn't much more overhead to update with the make commands, and it could potentially uncover a bug in our process if we have unexpected diffs in that intermediate state but the proof itself still passes. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| fn test_t(x: (u32,)) -> u32 { x.0 } // expects a singleton tuple | ||
|
|
||
| fn main() { | ||
| let single: u32 = 32; | ||
| let tuple: (u32,) = (single,); | ||
|
|
||
| test_t(tuple); // gets passed a singleton tuple | ||
|
|
||
| let identity = |x| x; // expects a single u32 | ||
|
|
||
| identity(single); // gets passed a &closure and a singleton tuple! | ||
|
|
||
| let twice = (single, single); | ||
| let is_equal = |a, b| { assert!(a == b); }; // expects and accesses its arguments as locals _2 and _3 (u32) | ||
|
|
||
| // is_equal(twice); // error | ||
| is_equal(single, single); // gets passed a &closure and a singleton tuple !!! | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.