rust/compiler
bors 9d20fd1098 Auto merge of #97684 - RalfJung:better-provenance-control, r=oli-obk
interpret: better control over whether we read data with provenance

The resolution in https://github.com/rust-lang/unsafe-code-guidelines/issues/286 seems to be that when we load data at integer type, we implicitly strip provenance. So let's implement that in Miri at least for scalar loads. This makes use of the fact that `Scalar` layouts distinguish pointer-sized integers and pointers -- so I was expecting some wild bugs where layouts set this incorrectly, but so far that does not seem to happen.

This does not entirely implement the solution to https://github.com/rust-lang/unsafe-code-guidelines/issues/286; we still do the wrong thing for integers in larger types: we will `copy_op` them and then do validation, and validation will complain about the provenance. To fix that we need mutating validation; validation needs to strip the provenance rather than complaining about it. This is a larger undertaking (but will also help resolve https://github.com/rust-lang/miri/issues/845 since we can reset padding to `Uninit`).

The reason this is useful is that we can now implement `addr` as a `transmute` from a pointer to an integer, and actually get the desired behavior of stripping provenance without exposing it!
2022-06-06 13:28:58 +00:00
..
rustc Auto merge of #96737 - ChrisDenton:win-manifest, r=wesleywiser 2022-06-02 07:58:29 +00:00
rustc_apfloat Addressed comments by @compiler-errors and @bjorn3 2022-03-30 17:04:46 -04:00
rustc_arena mark FIXMES for all the places found that are probably offset_from 2022-03-29 20:18:28 -04:00
rustc_ast Remove emit_unit 2022-06-03 17:02:14 +00:00
rustc_ast_lowering Auto merge of #97717 - matthiaskrgr:rollup-lalaii2, r=matthiaskrgr 2022-06-04 02:10:35 +00:00
rustc_ast_passes Support the #[expect] attribute on fn parameters (RFC-2383) 2022-06-04 00:50:45 +02:00
rustc_ast_pretty Revert #96682. 2022-06-02 11:22:16 +10:00
rustc_attr RFC3239: Implement compact cfg(target(..)) 2022-05-24 13:51:36 +02:00
rustc_borrowck Rollup merge of #97415 - cjgillot:is-late-bound-solo, r=estebank 2022-06-03 17:10:51 +02:00
rustc_builtin_macros Basic compiler infra 2022-06-02 09:00:04 -03:00
rustc_codegen_cranelift add cast kind of from_exposed_addr (int-to-ptr casts) 2022-06-02 10:46:13 -04:00
rustc_codegen_gcc Finish bumping stage0 2022-05-27 07:36:17 -04:00
rustc_codegen_llvm Auto merge of #97214 - Mark-Simulacrum:stage0-bump, r=pietroalbini 2022-05-29 16:28:21 +00:00
rustc_codegen_ssa Fix emscripten linker invocation 2022-06-03 17:02:14 +00:00
rustc_const_eval Auto merge of #97684 - RalfJung:better-provenance-control, r=oli-obk 2022-06-06 13:28:58 +00:00
rustc_data_structures Fix stacked borrows invalidation in rustc_data_structures sip128 2022-06-04 17:46:36 +02:00
rustc_driver typo: -Zcodegen-backend=llvm -Cpasses=list should work now 2022-06-05 07:02:32 +03:00
rustc_error_codes Use the same message as type & const generics. 2022-06-03 08:26:10 +02:00
rustc_error_messages migrate check_for_for_in_in_typo diagnostic 2022-05-31 16:28:05 -05:00
rustc_errors Auto merge of #97697 - WaffleLapkin:no_ref_vec, r=WaffleLapkin 2022-06-05 09:30:53 +00:00
rustc_expand Basic compiler infra 2022-06-02 09:00:04 -03:00
rustc_feature Auto merge of #97654 - Dylan-DPC:rollup-w6zrzxf, r=Dylan-DPC 2022-06-02 16:04:42 +00:00
rustc_fs_util
rustc_graphviz update graphviz links 2022-05-12 18:31:42 +09:00
rustc_hir Rollup merge of #97683 - cjgillot:no-apit-hrtb, r=nagisa 2022-06-06 08:37:00 +02:00
rustc_hir_pretty use hir::Let in hir::Guard 2022-05-09 20:35:58 +08:00
rustc_incremental rename visit item-like methods 2022-05-13 11:46:06 -04:00
rustc_index Auto merge of #95418 - cjgillot:more-disk, r=davidtwco 2022-05-20 20:49:55 +00:00
rustc_infer Replace &Vec<_>s with &[_]s 2022-06-03 20:42:42 +04:00
rustc_interface Remove support for -Zast-json and -Zast-json-noexpand 2022-06-03 16:46:20 +00:00
rustc_lexer Reduce max hash in raw strings from u16 to u8 2022-03-23 22:13:55 +01:00
rustc_lint Auto merge of #97086 - 5225225:link-section-is-unsafe, r=davidtwco 2022-06-06 10:43:27 +00:00
rustc_lint_defs Use serde_json for json error messages 2022-06-03 16:46:19 +00:00
rustc_llvm Add LLVM based mingw-w64 targets 2022-05-13 20:14:15 +02:00
rustc_log clippy::complexity fixes 2022-05-26 13:14:24 +02:00
rustc_macros Inline many methods of Encoder 2022-06-03 17:01:53 +00:00
rustc_metadata Remove emit_unit 2022-06-03 17:02:14 +00:00
rustc_middle Auto merge of #97684 - RalfJung:better-provenance-control, r=oli-obk 2022-06-06 13:28:58 +00:00
rustc_mir_build Replace &Vec<_>s with &[_]s 2022-06-03 20:42:42 +04:00
rustc_mir_dataflow Add a pointer to address cast kind 2022-05-31 00:00:00 +00:00
rustc_mir_transform Auto merge of #97697 - WaffleLapkin:no_ref_vec, r=WaffleLapkin 2022-06-05 09:30:53 +00:00
rustc_monomorphize Auto merge of #97168 - SparrowLii:accesses, r=cjgillot 2022-05-26 11:15:15 +00:00
rustc_parse Add spaces before and after expr in add {} suggestion 2022-06-06 01:40:52 +04:00
rustc_parse_format Make rustc_parse_format compile on stable 2022-05-03 11:26:58 +02:00
rustc_passes Encode MIR for 'unreachable' non-generic fns 2022-06-03 17:39:10 -07:00
rustc_plugin_impl
rustc_privacy Rollup merge of #97096 - tmiasko:reachable-constructor, r=petrochenkov 2022-05-18 07:40:58 +09:00
rustc_query_impl Remove emit_unit 2022-06-03 17:02:14 +00:00
rustc_query_system Address review comments. 2022-06-02 12:22:04 +10:00
rustc_resolve Rollup merge of #97683 - cjgillot:no-apit-hrtb, r=nagisa 2022-06-06 08:37:00 +02:00
rustc_save_analysis [save-analysis] Reference the variant not enum at struct-literal construction. 2022-05-12 16:34:02 -07:00
rustc_serialize Remove emit_unit 2022-06-03 17:02:14 +00:00
rustc_session Remove support for -Zast-json and -Zast-json-noexpand 2022-06-03 16:46:20 +00:00
rustc_span Inline many methods of Encoder 2022-06-03 17:01:53 +00:00
rustc_symbol_mangling Auto merge of #96883 - jackh726:early-binder-2, r=oli-obk 2022-05-14 23:53:11 +00:00
rustc_target Auto merge of #97684 - RalfJung:better-provenance-control, r=oli-obk 2022-06-06 13:28:58 +00:00
rustc_trait_selection Rollup merge of #97721 - compiler-errors:issue-97704, r=jackh726 2022-06-06 08:37:01 +02:00
rustc_traits Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
rustc_ty_utils Auto merge of #96964 - oli-obk:const_trait_mvp, r=compiler-errors 2022-05-30 09:19:03 +00:00
rustc_type_ir Inline many methods of Encoder 2022-06-03 17:01:53 +00:00
rustc_typeck Auto merge of #97697 - WaffleLapkin:no_ref_vec, r=WaffleLapkin 2022-06-05 09:30:53 +00:00