about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-26 13:27:35 +0000
committerbors <bors@rust-lang.org>2024-03-26 13:27:35 +0000
commit8b2b84e4831426d620ec05ce1f1fcdc321414d3d (patch)
tree7ba7199907d77fcb47be6d523d6771ba1f60529c /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent2e198d04ee1ccd20926701c4da7403d2c6bca7b3 (diff)
parentdf73cb710e2916a0ed25020f013cae1fb64ccc27 (diff)
downloadrust-8b2b84e4831426d620ec05ce1f1fcdc321414d3d.tar.gz
rust-8b2b84e4831426d620ec05ce1f1fcdc321414d3d.zip
Auto merge of #3415 - JoJoDeveloping:tree-borrows-initialized-root, r=RalfJung
Tree Borrows: Make tree root always be initialized

This PR fixes a slight annoyance we discovered while formally proving that certain optimizations are sound with Tree Borrows. In particular... (copied from the commit message):

There should never be an `Active` but not initialized node in the borrow tree. If such a node exists, and if it has a protector, then on a foreign read, it could become disabled. This leads to some problems when formally proving that read moving optimizations are sound.

The root node is the only node for which this can happen, since all other nodes can only become `Active` when actually used. But special-casing the root node here is annoying to reason about, everything becomes much nicer if we can simply say that *all* `Active` nodes must be initialized. This requires making the root node default-initialized.

This is also more intuitive, since the root arguably becomes initialized during the allocation, which can be considered a write.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions