about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2020-05-19update codegen of `discriminant_value`Bastian Kauschke-3/+6
2020-05-18Add asm! to MIRAmanieu d'Antras-0/+3
2020-05-16Auto merge of #71665 - RalfJung:miri-intern-no-ice, r=oli-obkbors-153/+180
Miri interning: replace ICEs by proper errors Fixes https://github.com/rust-lang/rust/issues/71316 I also did some refactoring, as I kept being confused by all the parameters to `intern_shallow`, some of which have invalid combinations (such as a mutable const). So instead `InternMode` now contains all the information that is needed and invalid combinations are ruled out by the type system. Also I removed interpreter errors from interning. We already ignored almost all errors, and the `ValidationFailure` errors that we handled separately actually cannot ever happen here. The only interpreter failure that was actually reachable was the UB on dangling pointers -- and arguably, a dangling raw pointer is not UB, so the error was not even correct. It's just that the rest of the compiler does not like "dangling" `AllocId`. It should be possible to review the 3 commits separately. r? @oli-obk Cc @rust-lang/wg-const-eval
2020-05-15InvalidUninitBytes: Track more info about accessDavid Cook-6/+8
2020-05-14Rollup merge of #72150 - jackh726:unnorm_projection, r=nikomatsakisRalf Jung-2/+0
Remove UnnormalizedProjection This was only used for the old chalk integration with chalk-engine r? @nikomatsakis
2020-05-12strings do not have to be valid UTF-8 any moreRalf Jung-3/+4
2020-05-12Remove ty::UnnormalizedProjectionJack Huey-2/+0
2020-05-10TypoRalf Jung-1/+1
Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
2020-05-10fmtRalf Jung-27/+16
2020-05-10avoid raising interpreter errors from interningRalf Jung-15/+24
2020-05-10remove some dead code, and assert we do not swallow allocating errorsRalf Jung-18/+19
2020-05-10Miri interning: replace ICEs by proper errors, make intern_shallow type ↵Ralf Jung-119/+147
signature more precise
2020-05-09Rollup merge of #71508 - oli-obk:alloc_map_unlock, r=RalfJungRalf Jung-19/+17
Simplify the `tcx.alloc_map` API This PR changes all functions that require manually locking the `alloc_map` to functions on `TyCtxt` that lock the map internally. In the same step we make the `TyCtxt::alloc_map` field private. r? @RalfJung
2020-05-08Auto merge of #71418 - hbina:rename_miri_undef, r=RalfJungbors-24/+24
Renamed "undef" -> "uninit" 1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-08Create a convenience wrapper for `get_global_alloc(id).unwrap()`Oliver Scherer-2/+2
2020-05-08Move `unwrap_fn` and `unwrap_memory` to `GlobalAlloc`Oliver Scherer-1/+1
2020-05-08Simplify the `tcx.alloc_map` APIOliver Scherer-19/+17
2020-05-07Renamed "undef" stuff to "uninit"Hanif Bin Ariffin-24/+24
1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-07use hex for pointers in Miri error messages; refine vtable error messageRalf Jung-3/+4
2020-05-06more precise vtable errorsRalf Jung-11/+14
2020-05-06try_validation: handle multi-branching, and use macro for most remaining ↵Ralf Jung-78/+47
manual throw_validation_failure sites
2020-05-06convert throw_validation_failure macro to same syntax as try_validationRalf Jung-56/+51
2020-05-06properly catch invalid-drop-fn errorsRalf Jung-6/+4
2020-05-06convert remaining try_validation to new macroRalf Jung-27/+25
2020-05-06validation: port more checks to the pattern-based macro (and give it the ↵Ralf Jung-30/+49
shorter name)
2020-05-04Auto merge of #71751 - oli-obk:const_ice, r=RalfJungbors-12/+8
Move recursion check for zsts back to read site instead of access check site Reverts https://github.com/rust-lang/rust/pull/71140#discussion_r413709446 Fix #71612 Fix #71709 r? @RalfJung
2020-05-03Rollup merge of #71663 - jumbatm:caller-handles-validation-error, r=RalfJungDylan DPC-31/+61
Fix exceeding bitshifts not emitting for assoc. consts (properly this time, I swear!) Fixes #69021 and fixes #71353. As described in https://github.com/rust-lang/rust/issues/71353#issuecomment-617901923, this PR: - adds a variant of `try_validation!` called `try_validation_pat!` that allows specific failures to be turned into validation failures (but returns the rest, unchanged), and - allows `InvalidProgram` to be returned out of validation r? @RalfJung
2020-05-02Rollup merge of #71738 - RalfJung:pointer-no-alloc-id, r=oli-obkRalf Jung-24/+22
remove AllocId generalization of Pointer This was only needed for the "snapshot" machinery, which is gone. r? @oli-obk
2020-05-01Remove a comment that made only sense in the original position of this cycle ↵Oliver Scherer-3/+1
check.
2020-05-01Move recursion check for zsts back to read site instead of access check site.Oliver Scherer-12/+10
2020-05-01Note that try_validation_pat can take a format str directly.jumbatm-0/+9
2020-05-01Manually format macro to not go over text width.jumbatm-2/+8
2020-05-01Expect at least one expr for p, what_fmt and expected_fmt.jumbatm-2/+2
2020-05-01Also make expected param wrapped in format_args.jumbatm-3/+3
2020-05-01Wrap try_validation_pat! args in format_args!jumbatm-3/+3
2020-05-01Update try_validation_pat! doc comment.jumbatm-2/+13
2020-05-01Apply suggestions for try_validation_pat!.jumbatm-12/+11
2020-05-01Fix comment to reflect error handling behaviour.jumbatm-1/+1
2020-05-01Allow unreachable_patterns instead of using `if true`jumbatm-1/+2
2020-05-01Match kind in try_validation_pat!.jumbatm-3/+3
Avoids having to repeat InterpErrorInfo { .. }
2020-05-01Add FIXME about replacing all usages of try_validation.jumbatm-0/+1
2020-05-01Apply suggestions from code reviewjumbatm-5/+5
Co-Authored-By: Ralf Jung <post@ralfj.de> Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
2020-05-01Throw validation failure for InvalidUndefBytes.jumbatm-1/+2
2020-05-01Don't fail for UndefinedBehaviourInfo in validation.jumbatm-2/+5
2020-05-01Don't duplicate body of try_validation.jumbatm-6/+3
2020-05-01Add try_validation_pat.jumbatm-1/+21
2020-05-01Don't duplicate macro for optional arg.jumbatm-24/+6
2020-05-01fmtRalf Jung-2/+2
2020-05-01remove AllocId generalization of PointerRalf Jung-23/+21
2020-05-01rename InvalidIntPtrUsageRalf Jung-6/+6