about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir/interpret/allocation.rs
AgeCommit message (Collapse)AuthorLines
2025-09-10interpret: copy_provenance: avoid large intermediate buffer for large repeat ↵Ralf Jung-2/+7
counts
2025-09-08const-eval: disable pointer fragment supportRalf Jung-0/+5
2025-07-30const-eval: full support for pointer fragmentsRalf Jung-34/+50
2025-07-17Report the range of uninit bytes in CTFE errorsOli Scherer-2/+5
2025-07-10interpret/allocation: expose init + write_wildcards on a rangeNia Espera-18/+15
2025-07-07compiler: Parse `p-` specs in datalayout string, allow definition of custom ↵Edoardo Marangoni-3/+3
default data address space
2025-07-02interpret: move the native call preparation logic into MiriRalf Jung-8/+1
2025-06-29give Pointer::into_parts a more scary name and offer a safer alternativeRalf Jung-2/+2
2025-05-28interpret/allocation: make alloc fn be FnOnceNia Espera-1/+1
2025-05-26extend allocbytes with associated typeNia Espera-17/+41
2025-03-15Move codec module back into middleMichael Goulet-6/+5
2025-03-13Auto merge of #137152 - saethlin:bss-const-allocs, r=wesleywiserbors-2/+115
Add a .bss-like scheme for encoded const allocs This check if all bytes are zero feel like it should be too slow, and instead we should have a flag that we track, but that seems hard. Let's see how this perfs first. Also we can probably stash the "it's all zero actually" flag inside one of the other struct members that's already not using an entire byte. This optimization doesn't fire all that often, so it's possible that by sticking it in the varint length field, this PR actually makes rmeta size worse.
2025-03-11miri native_calls: ensure we actually expose *mutable* provenance to the ↵Ralf Jung-0/+5
memory FFI can access
2025-03-06Rollup merge of #137920 - RalfJung:provenance-map-emptiness, r=oli-obkMichael Goulet-1/+1
interpret/provenance_map: consistently use range_is_empty https://github.com/rust-lang/rust/pull/137704 started using this for per-ptr provenance; let's be consistent and use it also for the per-byte provenance check. Also rename the methods to avoid having both "get" and "is_empty" in the name. r? ````@oli-obk````
2025-03-03interpret/provenance_map: consistently use range_is_emptyRalf Jung-1/+1
2025-03-02Revert "Auto merge of #135335 - oli-obk:push-zxwssomxxtnq, r=saethlin"Michael Goulet-1/+1
This reverts commit a7a6c64a657f68113301c2ffe0745b49a16442d1, reversing changes made to ebbe63891f1fae21734cb97f2f863b08b1d44bf8.
2025-02-19Add a .bss-like scheme for encoded const allocsBen Kimock-2/+115
2025-02-08Rustfmtbjorn3-4/+7
2025-01-28miri: optimize zeroed allocSpecificProtagonist-6/+20
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-01-21Also generate undef scalars and scalar pairsOli Scherer-1/+1
2024-12-05extend Miri to correctly pass mutable pointers through FFIStrophox-0/+22
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-11-03compiler: Directly use rustc_abi in metadata and middleJubilee Young-1/+1
Stop reexporting ReprOptions from middle::ty
2024-10-19interpret errors: add map_err_kind, rename InterpError -> InterpErrorKindRalf Jung-10/+10
2024-10-01make InterpResult a dedicated type to avoid accidentally discarding the errorRalf Jung-7/+8
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-3/+3
2024-09-12Rollup merge of #130235 - compiler-errors:nested-if, r=michaelwoeristerStuart Cook-16/+14
Simplify some nested `if` statements Applies some but not all instances of `clippy::collapsible_if`. Some ended up looking worse afterwards, though, so I left those out. Also applies instances of `clippy::collapsible_else_if` Review with whitespace disabled please.
2024-09-11Rollup merge of #130114 - eduardosm:needless-returns, r=compiler-errorsJubilee-1/+1
Remove needless returns detected by clippy in the compiler
2024-09-11Simplify some nested if statementsMichael Goulet-16/+14
2024-09-09Remove needless returns detected by clippy in the compilerEduardo Sánchez Muñoz-1/+1
2024-09-08interpret: reset provenance on typed copiesRalf Jung-0/+6
2024-08-30enable Miri to pass const pointers through FFIStrophox-1/+2
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-08-14use the new Box methods in the interpreterRalf Jung-4/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-8/+4
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-21add as_ptr to trait AllocBytes, fix 2 impls; add pub fn ↵Strophox-3/+23
get_bytes_unchecked_raw in allocation.rs; add pub fn get_alloc_bytes_unchecked_raw[_mut] in memory.rs
2024-06-17interpret: better error when we ran out of memoryRalf Jung-2/+5
2024-05-27miri: avoid making a full copy of all new allocationsRalf Jung-22/+21
2024-05-03remove trait bounds on AllocBytesStrophox-3/+1
2024-05-03Cow::from(&*...) changed to Cow::Owned(Vec::from(...))Strophox-1/+1
2024-05-03generalize adjust_from_tcxStrophox-4/+4
2024-04-29Remove `extern crate rustc_macros` from `rustc_middle`.Nicholas Nethercote-0/+1
2024-03-15interpret/allocation: fix aliasing issue in interpreter and refactor getters ↵Ralf Jung-11/+31
a bit - rename mutating functions to be more scary - add a new raw bytes getter
2024-01-10Add `DiagCtxt::delayed_bug`.Nicholas Nethercote-4/+1
We have `span_delayed_bug` and often pass it a `DUMMY_SP`. This commit adds `delayed_bug`, which matches pairs like `err`/`span_err` and `warn`/`span_warn`.
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-1/+1
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-8/+8
is immutable
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-1/+1
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-10-14interpret: clean up AllocBytesRalf Jung-13/+5
2023-08-09Convert Const to Allocation in smirouz-a-0/+3
2023-08-02const validation: point at where we found a pointer but expected an integerRalf Jung-25/+41
2023-07-25add some sanity checks in write_immediate_no_validateRalf Jung-1/+1
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-19/+29