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

Make the macro system more modular. #451

Closed
wants to merge 64 commits into from

Conversation

paulstansifer
Copy link
Contributor

No description provided.

paulstansifer and others added 30 commits June 2, 2011 18:58
So that the tinderboxes can go green again. Patrick, please look into
this at some point.
This is accepted everywhere, since just passing a pointer is safe.
Introduce an ext_ctxt record to provide a span_err method for use while
expanding syntax extensions. Hopefully it will be useful for other things.
After this we can remove the parser from the syntax extensions, at least for
now.
Eventually extensions will probably need access to the parser again, but it'll
be in a different form.
This is not obnoxious now that logging is off by default
graydon and others added 24 commits June 9, 2011 10:46
… and ty_local.

Sorry, big perf regression; will fix soon.
… has vars before folding over it; also remove some debug code. 2x typechecking speedup.
Some of the vec utilities now only work on immutable vecs, since they
would have to be rewritten to do a lot more copying to be alias-safe.

Some forced copying was added to map.rs, showing a weakness in the
alias checker (or maybe the alias system): when fn args are passed
into a function, calling them must assume all aliases that are not
immutably rooted (directly connected to a local or temporary without
any mutable edges) become invalid. This will be a drag on functional
programming in Rust.

Work around alias issues in the stdlib
The old system tried to ensure that the location an alias pointed at
would retain its type. That turned out to not be strong enough in the
face of aliases to the inside of tags.

The new system instead proves that values pointed to by aliases are
not replaced (or invalidated in some other way) at all. It knows of
two sufficient conditions for this, and tries to prove at least of
them:

A) The alias is 'immutably rooted' in a local, and this local is not
   reassigned for the lifetime of the alias. Immutably rooted means
   the alias refers to the local itself, or to something reachable
   from the local through immutable dereferencing.

B) No value whose type might include the type of the 'inner mutable
   element' of the thing the alias refers to (for example, the box in
   rec(mutable x = @mutable int)) is from the outer scope is accessed
   for the lifetime of the alias. This means for functions, no other
   argument types may include the alias's inner mutable type. For alt,
   for each, and for, it means the body does not refer to any locals
   originating from outside their scope that include this type.

The lifetime of an alias in an alt, for each, or for body is defined
as the range from its definition to its last use, not to the point
where it goes out of scope. This makes working around these
restrictions somewhat less annoying. For example, you can assign to
your alt-ed value you don't refer to any bindings afterwards.
There was a bug that would cause the alias analyser to allow you to
invalidate an alias that was no longer directly referred to, even if
another alias was rooted in it. It now properly tracks dependencies
between live aliases.

Required another case of copying values in map.rs.
@paulstansifer
Copy link
Contributor Author

This pull request is obsolete; the commits have already been merged:

graydon@79fcd51
graydon@dbd066a

keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this pull request Dec 12, 2017
Remove constants no longer present in FreeBSD 11
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this pull request Mar 7, 2023
* Speed up type canonicalization

* Speed up vector insertion

* Speed up only

* Speed up only
celinval added a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
…lang#557)

When building multiple dependencies, rmc compilation generates multiple
*json files which need to be merged before running CBMC.

This remove the assumption that only json file is generated and use all
the generated json files to generated the gotoc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants