about summary refs log tree commit diff
path: root/src/librustc_mir/interpret/validity.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-922/+0
2020-08-08Miri: Renamed "undef" to "uninit"Philippe Nadon-4/+4
Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - src/librustc_codegen_llvm/consts.rs - src/librustc_middle/mir/interpret/ - src/librustc_middle/ty/print/pretty.rs - src/librustc_mir/ - src/tools/clippy/clippy_lints/src/consts.rs Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193
2020-07-22renamed ScalarMaybeUninit::not_undef to check_initPhilippe Nadon-3/+3
Renamed the function ScalarMaybeUninit::not_undef to ScalarMaybeUninit::check_init in the file src/librustc_middle/mir/interpret/value.rs, to reflect changes in terminology used. Related issue rust-lang#71193
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-1/+1
2020-07-10Avoid "whitelist"Tamir Duberstein-1/+1
Other terms are more inclusive and precise.
2020-07-05fmtRalf Jung-4/+9
2020-07-05catch errors more locally around read_discriminantRalf Jung-20/+30
2020-07-05catch InvalidUninitBytes during validationRalf Jung-5/+11
2020-06-19Rollup merge of #72497 - RalfJung:tag-term, r=oli-obkRalf Jung-4/+4
tag/niche terminology cleanup The term "discriminant" was used in two ways throughout the compiler: * every enum variant has a corresponding discriminant, that can be given explicitly with `Variant = N`. * that discriminant is then encoded in memory to store which variant is active -- but this encoded form of the discriminant was also often called "discriminant", even though it is conceptually quite different (e.g., it can be smaller in size, or even use niche-filling). After discussion with @eddyb, this renames the second term to "tag". The way the tag is encoded can be either `TagEncoding::Direct` (formerly `DiscriminantKind::Tag`) or `TagEncoding::Niche` (formerly `DiscrimianntKind::Niche`). This finally resolves some long-standing confusion I had about the handling of variant indices and discriminants, which surfaced in https://github.com/rust-lang/rust/pull/72419. (There is also a `DiscriminantKind` type in libcore, it remains unaffected. I think this corresponds to the discriminant, not the tag, so that seems all right.) r? @eddyb
2020-06-15make all uses of ty::Error or ConstKind::Error delay a span bugmark-1/+1
2020-06-01Auto merge of #71192 - oli-obk:eager_alloc_id_canonicalization, r=wesleywiserbors-0/+1
Make TLS accesses explicit in MIR r? @rust-lang/wg-mir-opt cc @RalfJung @vakaras for miri thread locals cc @bjorn3 for cranelift fixes #70685
2020-05-30Rollup merge of #72772 - RalfJung:valid-char, r=petrochenkovRalf Jung-1/+1
miri validation: clarify valid values of 'char' The old text said "expected a valid unicode codepoint", which is not actually correct -- it has to be a scalar value (which is a code point that is not part of a surrogate pair).
2020-05-30miri errors: rename InvalidDiscriminant -> InvalidTagRalf Jung-2/+2
2020-05-30tag/niche terminology cleanupRalf Jung-2/+2
2020-05-30Make TLS accesses explicit in MIROliver Scherer-0/+1
2020-05-30miri validation: clarify valid values of 'char'Ralf Jung-1/+1
2020-05-25Rename upvar_list to closure_capturesDhruv Jauhar-1/+1
As part of supporting RFC 2229, we will be capturing all the places that are mentioned in a closure. Currently the upvar_list field gives access to a FxIndexMap<HirId, Upvar> map. Eventually this will change, with the upvar_list having a more general structure that expresses captured paths, not just the mentioned upvars. We will make those changes in subsequent PRs. This commit modifies the name of the upvar_list map to closure_captures in TypeckTables. Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com> Co-authored-by: Aman Arora <me@aman-arora.com>
2020-05-22Rollup merge of #71610 - divergentdave:InvalidUndefBytes-range, r=RalfJungRalf Jung-6/+8
InvalidUndefBytes: Track size of undef region used This PR adds a size to `UndefinedBehaviorInfo::InvalidUndefBytes`, to keep track of how many undefined bytes in a row were accessed, and changes a few methods to pass this information through. This additional information will eventually be used in Miri to improve diagnostics for this UB error. See also rust-lang/miri#1354 for prior discussion. I expect Miri will break the next time its submodule is updated, due to this change to the `InvalidUndefBytes`. (The current commit for src/tools/miri predates rust-lang/miri#1354, and thus does not try to destructure the `InvalidUndefBytes` variant) I have a corresponding change prepared for that repository. r? @RalfJung
2020-05-15InvalidUninitBytes: Track more info about accessDavid Cook-6/+8
2020-05-14Rollup merge of #72150 - jackh726:unnorm_projection, r=nikomatsakisRalf Jung-1/+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-1/+0
2020-05-09Rollup merge of #71508 - oli-obk:alloc_map_unlock, r=RalfJungRalf Jung-1/+1
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-4/+4
Renamed "undef" -> "uninit" 1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-08Simplify the `tcx.alloc_map` APIOliver Scherer-1/+1
2020-05-07Renamed "undef" stuff to "uninit"Hanif Bin Ariffin-4/+4
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-74/+46
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-0/+1
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-29/+48
shorter name)
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-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