rust/src/test
Dylan DPC 71bf986f4b
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
2020-04-30 14:07:55 +02:00
..
assembly
auxiliary
codegen Fix codegen and mir-opt tests 2020-04-20 21:18:20 +02:00
codegen-units Keep codegen units unmerged when building compiler builtins 2020-04-06 00:00:00 +00:00
compile-fail typeck: workaround WF hole in to_const. 2020-04-14 19:31:31 +03:00
debuginfo Update the minimum external LLVM to 8 2020-04-14 12:44:41 -07:00
incremental Moving more build-pass tests to check-pass 2020-04-23 20:21:38 -07:00
mir-opt Auto merge of #70175 - Amanieu:remove_nlp, r=pnkfelix 2020-04-30 07:04:43 +00:00
pretty Update tests to use llvm_asm! 2020-03-26 15:49:22 +00:00
run-fail Auto merge of #70175 - Amanieu:remove_nlp, r=pnkfelix 2020-04-30 07:04:43 +00:00
run-make
run-make-fulldeps Rollup merge of #71489 - spastorino:fix-treat-err-as-bug-handling, r=eddyb 2020-04-28 13:12:14 +02:00
run-pass-valgrind
rustdoc Fix show-const-contents rustdoc test 2020-04-20 23:38:07 +02:00
rustdoc-js
rustdoc-js-std Add tests for new of variables 2020-03-16 18:30:26 +01:00
rustdoc-ui Add rustdoc regression test for the unused_braces lint 2020-04-24 19:15:07 +02:00
rustfix
ui Rollup merge of #71655 - RalfJung:const-pattern-soundness, r=oli-obk 2020-04-30 14:07:55 +02:00
ui-fulldeps Remove support for self-opening 2020-04-25 10:55:20 -04:00
COMPILER_TESTS.md rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org 2020-03-10 17:08:18 -03:00