about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-30 14:07:55 +0200
committerGitHub <noreply@github.com>2020-04-30 14:07:55 +0200
commit71bf986f4b2949a1eaf7db339e6995065b3d1988 (patch)
tree3dc25ddf97f5158b9e473d1a3422a3b43fbfcdf3 /src/rustllvm/RustWrapper.cpp
parent58d955e6cc84b92a6013a3e170e076f65a0c1b18 (diff)
parent07772fcf6fca44217439154aa37e4854dd5aef34 (diff)
downloadrust-71bf986f4b2949a1eaf7db339e6995065b3d1988.tar.gz
rust-71bf986f4b2949a1eaf7db339e6995065b3d1988.zip
Rollup merge of #71655 - RalfJung:const-pattern-soundness, r=oli-obk
Miri: better document and fix dynamic const pattern soundness checks

https://github.com/rust-lang/const-eval/issues/42 got me thinking about soundness for consts being used in patterns, and I found a hole in our existing dynamic checks: a const referring to a mutable static *in a different crate* was not caught. This PR fixes that. It also adds some comments that explain which invariants are crucial for soundness of const-patterns.

Curiously, trying to weaponize this soundness hole failed: pattern matching compilation ICEd when encountering the cross-crate static, saying "expected allocation ID alloc0 to point to memory". I don't know why that would happen, statics *should* be entirely normal memory for pattern matching to access.

r? @oli-obk
Cc @rust-lang/wg-const-eval
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions