Skip to content
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

AST alt arms should take an expression instead of a block #3085

Closed
brson opened this issue Aug 1, 2012 · 8 comments · Fixed by #12669
Closed

AST alt arms should take an expression instead of a block #3085

brson opened this issue Aug 1, 2012 · 8 comments · Fixed by #12669
Labels
A-frontend Area: frontend (errors, parsing and HIR) C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Aug 1, 2012

The parser is inserting an extra block into every alt arm.

@ghost ghost assigned brson Aug 2, 2012
@brson
Copy link
Contributor Author

brson commented Aug 7, 2012

I started on this but hit some code in the auto_serializer that I didn't understand.

@graydon
Copy link
Contributor

graydon commented Mar 25, 2013

non-critical for 0.6, de-milestoning

@catamorphism
Copy link
Contributor

Doing this between builds.

@ghost ghost assigned catamorphism Jul 18, 2013
@pnkfelix
Copy link
Member

pnkfelix commented Oct 9, 2013

Visiting for triage, email from 2013 sep 30.

@catamorphism did you make progress on it?

@catamorphism
Copy link
Contributor

@pnkfelix Sort of -- I made some progress in a branch but then I broke everything. I'm still planning to get to it, but given that it would be hard to rebase, maybe someone should just start over.

@pnkfelix
Copy link
Member

pnkfelix commented Oct 9, 2013

@catamorphism can you provide a pointer to the branch, in case someone wants to look at your commits as inspiration and/or basis for work estimate?

@catamorphism
Copy link
Contributor

@pnkfelix: Sure, here it is: https://github.com/catamorphism/rust/tree/issue-3085-totally-broken

It's not rebased at all. I don't even remember the error message I was getting -- just that I felt like I was getting somewhere and then suddenly, something incomprehensible and seemingly unrelated (possibly related to deriving(Encodable) and so on?) was broken, and I gave up.

@huonw
Copy link
Member

huonw commented Mar 2, 2014

Triage, no change; I might have a go at this later.

bors added a commit that referenced this issue Mar 4, 2014
syntax: make match arms store the expr directly.

Previously `ast::Arm` was always storing a single `ast::Expr` wrapped in an
`ast::Block` (for historical reasons, AIUI), so we might as just store
that expr directly.

Closes #3085.
@huonw huonw closed this as completed in c3b9047 Mar 4, 2014
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
.gitignore: Ignore Emacs backup files
RalfJung pushed a commit to RalfJung/rust that referenced this issue Sep 28, 2023
fix normalization in backtrace-api tests

also remove a normalization rule that doesn't seem to apply
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
This is still incomplete, but hopefully it can be merged as an unstable
feature. I'll publish an RFC shortly.

This instruments the function body with assertion checks to see if users
are generating invalid values. This covers:
  - Union access
  - Raw pointer dereference
  - Transmute value
  - Field assignment of struct with invalid values
  - Aggregate assignment

Things not covered today should trigger ICE or a delayed verification
failure due to unsupported feature.

## Design

This change has two main design changes which are inside the new
`kani_compiler::kani_middle::transform` module:
1- Instance body should now be retrieved from the `BodyTransformation`
structure. This structure will run transformation passes on instance
bodies (i.e.: monomorphic instances) and cache the result.
2- Create a new transformation pass that instruments the body of a
function for every potential invalid value generation.
3- Create a body builder which contains all elements of a function body
and mutable functions to modify them accordingly.


Related to rust-lang#2998
Fixes rust-lang#301 

---------

Co-authored-by: Zyad Hassan <[email protected]>
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
In the previous PR rust-lang#3085, we did not support checks for `write_bytes`
which is added in this PR.

I am waiting for rust-lang#3092 to add expected tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: frontend (errors, parsing and HIR) C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants