| Age | Commit message (Collapse) | Author | Lines |
|
Add support for relating slices in `super_relate_consts`
This allows passing strings as generic arguments.
Fixes #63773
Fixes #60813
r? @varkor
|
|
|
|
This allows us to avoid changing things directly in the miri engine just
for const prop.
|
|
|
|
|
|
|
|
rename Allocation::retag -> with_tags_and_extra
This is more consistent with `Pointer::with_tag`. Also, "retag" is a [term from Stacked Borrows](https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md#retagging) with a [corresponding Machine hook](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/interpret/machine/trait.Machine.html#method.retag), and this function has nothing to do with that other use of the term.
r? @oli-obk
|
|
document Miri error categories
r? @oli-obk
|
|
|
|
|
|
|
|
Fix minor typo in docs.
This comment is prolly refering to the comment in [const_eval_raw_provider](https://github.com/rust-lang/rust/pull/64116/files#diff-e0b58bb6712edaa8595ad7237542c958R616), not itself.
|
|
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
|
|
Fixed grammar/style in some error messages
Factored out from hacking on rustc for work on the REPL.
r? @Centril
|
|
|
|
|
|
Value was renamed to Operand in https://github.com/rust-lang/rust/commit/ad2de8b4ee099916113b7b3577ac86857b1568be
ScalarPair to Slice in https://github.com/rust-lang/rust/commit/fe50b4eb1d6f7a31c53798bca3d0fa2b0670fa3d
Not familiar enough with rustc's source to know if the comment is even still applicable.
|
|
Make Allocation::bytes private
Fixes #62931.
Direct immutable access to the bytes is still possible but redirected through the new method `raw_bytes_with_undef_and_ptr`, similar to `get_bytes_with_undef_and_ptr` but without requiring an interpretation context and not doing *any* relocation or bounds checks. The `size` of the allocation is stored separately which makes access as `Size` and `usize` more ergonomic.
cc: @RalfJung
|
|
This improves the clarity of the documentation a bit since they can
reference each other when reading the member docs in sequence.
|
|
|
|
|
|
|
|
|
|
|
|
There is now a dedicate `len` method which avoids the need to access the
bytes. Access the length as `Size` can also be done by a direct member.
The constructors guarantee that these representations are convertable.
Access which relies on the bytes, such as snapshot, can use direct raw
access by reference as it does not care about undef and relocations or
properly checks them seperately.
|
|
Size has a ::zero
|
|
|
|
|
|
This also means that the compressed representation chosen may be
optimized together with any changes to the undef_mask.
|
|
Requires a manual implementation for Relocations since dereferencing to
SortedMap is not always implemented but that one is far more trivial.
Added fields could otherwise be silently forgotten since private fields
make destructing outside the module possible only with `..` pattern
which would then also be applicable to newly added public fields.
|
|
Direct access to the bytes was previously a problem (#62931) where
components would read their contents without properly checking
relocations and/or definedness.
Making bytes private instead of purely renaming them also helps in
allowing amendments to their allocation scheme (such as eliding
allocation for undef of constant regions).
|
|
Miri: Check that a ptr is aligned and inbounds already when evaluating `*`
This syncs Miri with what the Nomicon and the Reference say, and resolves https://github.com/rust-lang/miri/issues/447.
Also this would not have worked without https://github.com/rust-lang/rust/pull/62982 due to new cycles. ;)
r? @oli-obk
|
|
|
|
Always error on `SizeOverflow` during mir evaluation
Fix #55878, fix #25116.
r? @oli-obk
|
|
CTFE: simplify ConstValue by not checking for alignment
I hope the test suite actually covers the problematic cases here?
r? @oli-obk
Fixes https://github.com/rust-lang/rust/issues/61952
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unsupported cases
|
|
|
|
|
|
|
|
|
|
|
|
|