about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/interpret/validity.rs
AgeCommit message (Collapse)AuthorLines
2021-09-07Rename rustc_mir to rustc_const_eval.Camille GILLOT-965/+0
2021-09-02rustc_target: move `LayoutOf` to `ty::layout`.Eduard-Mihai Burtescu-4/+2
2021-08-25Auto merge of #88242 - bonega:allocation_range, r=oli-obkbors-19/+8
Use custom wrap-around type instead of RangeInclusive Two reasons: 1. More memory is allocated than necessary for `valid_range` in `Scalar`. The range is not used as an iterator and `exhausted` is never used. 2. `contains`, `count` etc. methods in `RangeInclusive` are doing very unhelpful(and dangerous!) things when used as a wrap-around range. - In general this PR wants to limit potentially confusing methods, that have a low probability of working. Doing a local perf run, every metric shows improvement except for instructions. Max-rss seem to have a very consistent improvement. Sorry - newbie here, probably doing something wrong.
2021-08-23Rename to WrappingRangeAndreas Liljeqvist-4/+4
2021-08-23Use refAndreas Liljeqvist-1/+1
2021-08-22Use custom wrap-around type instead of RangeAndreas Liljeqvist-19/+8
2021-08-22Fix typos “an”→“a” and a few different ones that appeared in the ↵Frank Steffahn-1/+1
same search
2021-07-16get rid of incorrect erase_for_fmtRalf Jung-5/+8
2021-07-14remove unused error variantRalf Jung-8/+3
2021-07-14consistently treat None-tagged pointers as ints; get rid of some deprecated ↵Ralf Jung-2/+2
Scalar methods
2021-07-14CTFE/Miri engine Pointer type overhaul: make Scalar-to-Pointer conversion ↵Ralf Jung-18/+8
infallible This resolves all the problems we had around "normalizing" the representation of a Scalar in case it carries a Pointer value: we can just use Pointer if we want to have a value taht we are sure is already normalized.
2021-06-14Adjust `throw_validation_failure` macro to shorten the use of ↵Rémy Rakic-13/+10
`with_no_trimmed_paths`
2021-06-13Improve CTFE validation error messageRémy Rakic-8/+12
2021-06-13Turn incorrect vtable size/alignment errors into hard const-UB errorsRémy Rakic-1/+5
They were "freeform const UB" error message, but could reach validation and trigger ICEs there. We now catch them during validation to avoid that.
2021-05-18add Align::ONE; add methods to access alloc.extraRalf Jung-2/+2
2021-05-18CTFE core engine allocation & memory API improvemenetsRalf Jung-28/+28
- make Allocation API offset-based (no more Pointer) - make Memory API higher-level (combine checking for access and getting access into one operation)
2021-05-15handle pointers in strRalf Jung-0/+1
2021-05-06use CheckInAllocMsg::PointerArithmeticTest for ptr_offset errorRalf Jung-2/+2
2021-05-02Change 'NULL' to 'null'Brent Kerby-3/+3
2021-03-18Replace closures_captures and upvar_capture with closure_min_capturesJennifer Wills-10/+13
make changes to liveness to use closure_min_captures use different span borrow check uses new structures rename to CapturedPlace stop using upvar_capture in regionck remove the bridge cleanup from rebase + remove the upvar_capture reference from mutability_errors.rs remove line from livenes test make our unused var checking more consistent update tests adding more warnings to the tests move is_ancestor_or_same_capture to rustc_middle/ty update names to reflect the closures add FIXME check that all captures are immutable borrows before returning add surrounding if statement like the original move var out of the loop and rename Co-authored-by: Logan Mosier <logmosier@gmail.com> Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
2021-02-20Auto merge of #82124 - tmiasko:op-ty-ref, r=oli-obkbors-20/+20
Pass large interpreter types by reference, not value r? `@ghost`
2021-02-17Reduce size of InterpErrorInfo to 8 bytesTomasz Miąsko-12/+15
2021-02-16Pass MPlaceTy by reference not valueTomasz Miąsko-1/+1
2021-02-16Pass ImmTy by reference not valueTomasz Miąsko-1/+1
2021-02-16Pass OpTy by reference not valueTomasz Miąsko-18/+18
2021-02-16validation: fix invalid-fn-ptr error messageRalf Jung-1/+4
2021-02-13CTFE validation: catch ReadPointerAsBytes and better errorRalf Jung-13/+29
2021-01-18Fix ICE with `ReadPointerAsBytes` validation errorCamelid-1/+5
2020-12-30Rollup merge of #80491 - RalfJung:dangling-of-val, r=oli-obkMara Bos-1/+1
Miri: make size/align_of_val work for dangling raw ptrs This is needed for https://github.com/rust-lang/rust/issues/80365#issuecomment-752128105. r? `@oli-obk`
2020-12-30where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)Matthias Krüger-1/+1
2020-12-29Miri: make size/align_of_val work for dangling raw ptrsRalf Jung-1/+1
2020-12-20promoteds in statics may refer to staticsRalf Jung-8/+12
2020-10-29Rollup merge of #78475 - RalfJung:validity-comment, r=oli-obkYuki Okushi-2/+1
fix a comment in validity check A few things changed since that comment was written; update it to the current reality. r? @oli-obk
2020-10-28fix a comment in validity checkRalf Jung-2/+1
2020-10-26interning cleanup: we no longer need to distinguish Const and ConstInner; we ↵Ralf Jung-2/+6
no longer need the ignore_interior_mut_in_const hack
2020-10-26move &mut-in-const check from interning to validationRalf Jung-1/+9
2020-10-26move UnsafeCell-in-const check from interning to validationRalf Jung-29/+45
2020-10-21Miri engine validity check: simplify code with 'matches!'Ralf Jung-12/+8
and improve a comment a bit
2020-09-19Address review commentsOliver Scherer-17/+17
2020-09-19Validate constants during `const_eval_raw`Oliver Scherer-8/+10
2020-09-04Change ty.kind to a methodLeSeulArtichaut-7/+7
2020-09-02pretty: trim paths of unique symbolsDan Aloni-12/+16
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-30mv compiler to compiler/mark-0/+922