[edit for readability] initial version of a Stacked Borrows spec #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I asked @nikomatsakis where I could put such a document, and he said this repo wouldn't be a bad place. So here you go, a description of Stacked Borrows that I intend to keep in sync with the implementation in Miri.
I don't have much experience writing specs in English as opposed to maths with lots of Greek letters, so I'd welcome feedback that helps clarify ambiguities.
However, this of course touches on all sorts of other aspects of MIR that still lack any form of specification. If I had a clone I'd make him write that spec, but the way things are I am not sure when I will have the time to write down how I think one could go about specifying a Rust abstract machine by specifying idealized MIR. (That will certainly involve defining the state of the abstract machine using Rust types so that at least that part is reasonably precise.) So I'm afraid there'll probably be some ambiguities that I cannot really resolve inside this document alone.
Also, please let's not discuss the actual content of the spec at this point. This is not intended to reflect any form of consensus amongst the UCG, it is just describing a possible aliasing model that we might eventually use as the basis of a discussion at the end of which we might have some form of consensus. This PR serves just to obtain some document matching the current implementation.