Moulins
39cfe70e4f
CTFE: move target_{i, u}size_{min, max) to rustc_abi::TargetDataLayout
2023-07-21 03:31:47 +02:00
Moulins
76c49aead6
support non-null pointer niches in CTFE
2023-07-21 03:31:45 +02:00
Mark Rousskov
cc907f80b9
Re-format let-else per rustfmt update
2023-07-12 21:49:27 -04:00
Deadbeef
4f83717cf7
Use translatable diagnostics in rustc_const_eval
2023-06-01 14:45:18 +00:00
Ben Kimock
606ca4da7e
Report a backtrace for memory leaks under Miri
2023-04-16 08:52:00 -04:00
Rune Tynan
936b567d2e
Minimal changes to make miri work
2023-02-20 13:50:20 -05:00
Rune Tynan
f1f40ac05c
Fix alloc_base_addr type
2023-02-20 13:47:12 -05:00
Rune Tynan
6f407d67b8
Allow non-Box allocations in preparation for aligned const allocations for miri. Credit to emarteca for the code.
2023-02-20 13:47:09 -05:00
Kyle Matsuda
8e92849cbb
changes from review
2023-02-16 17:05:59 -07:00
Kyle Matsuda
c183110cc2
remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata
2023-02-16 17:05:56 -07:00
Kyle Matsuda
d822b97a27
change usages of type_of to bound_type_of
2023-02-16 17:01:52 -07:00
Oli Scherer
38b7cdf393
Use target instead of machine for mir interpreter integer handling.
...
The naming of `machine` only makes sense from a mir interpreter internals perspective, but outside users talk about the `target` platform
2023-02-15 08:56:18 +00:00
Ralf Jung
2900ba15b3
miri: fix ICE when running out of address space
2023-02-07 13:26:31 +01:00
Maybe Waffle
4d75f61832
Use Mutability::{is_mut, is_not}
2023-01-30 12:26:26 +00:00
bors
56ee85274e
Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstrieb
...
Remove some `ref` patterns from the compiler
Previous PR: https://github.com/rust-lang/rust/pull/105368
r? `@Nilstrieb`
2023-01-20 04:52:28 +00:00
Maybe Waffle
6a28fb42a8
Remove double spaces after dots in comments
2023-01-17 08:09:33 +00:00
Maybe Waffle
3dca58e249
rustc_const_eval: remove ref patterns (+some pattern matching imps)
2023-01-17 07:48:19 +00:00
Oli Scherer
d9d92ed7da
Move alignment failure error reporting to machine
2022-12-15 16:07:35 +00:00
Oli Scherer
d66824dbc4
Make alignment checks a future incompat lint
2022-12-15 16:07:28 +00:00
Oli Scherer
ed71e32e14
Always pass alignment and handle checking lazily
2022-12-15 15:51:43 +00:00
Ralf Jung
1115ec601a
cleanup and dedupe CTFE and Miri error reporting
2022-11-16 10:13:29 +01:00
bors
a00f8ba7fc
Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obk
...
interpret: support for per-byte provenance
Also factors the provenance map into its own module.
The third commit does the same for the init mask. I can move it in a separate PR if you prefer.
Fixes https://github.com/rust-lang/miri/issues/2181
r? `@oli-obk`
2022-11-15 17:37:15 +00:00
Ralf Jung
68af46c112
assert that we are (de)seiralizing ProvenanceMap correctly
2022-11-14 18:26:40 +01:00
Ralf Jung
c78021709a
add is_sized method on Abi and Layout, and use it
2022-11-13 12:23:53 +01:00
Ralf Jung
c3a7ca1125
move InitMask to its own module
2022-11-06 14:17:10 +01:00
Ralf Jung
2cef9e3d19
interpret: support for per-byte provenance
2022-11-06 14:17:10 +01:00
Rageking8
7122abaddf
more dupe word typos
2022-10-14 12:57:56 +08:00
Dezhi Wu
b1430fb7ca
Fix a bunch of typo
...
This PR will fix some typos detected by [typos].
I only picked the ones I was sure were spelling errors to fix, mostly in
the comments.
[typos]: https://github.com/crate-ci/typos
2022-08-31 18:24:55 +08:00
Ralf Jung
2e172473da
interpret: make read-pointer-as-bytes *always* work in Miri
...
and show some extra information when it happens in CTFE
2022-08-27 18:37:44 -04:00
Ralf Jung
e63a625711
interpret: rename relocation → provenance
2022-08-27 14:11:19 -04:00
Ralf Jung
30fa931f92
make read_immediate error immediately on uninit, so ImmTy can carry initialized Scalar
2022-08-26 13:20:57 -04:00
Ralf Jung
2e52fe01cf
remove some now-unnecessary parameters from check_bytes
2022-08-26 13:20:56 -04:00
Ralf Jung
9d604f301b
fix an outdated machine hook name
2022-08-26 13:20:56 -04:00
Ben Kimock
a5cc3a0557
Rename Machine memory hooks to suggest when they run
2022-08-15 19:54:43 -04:00
Ralf Jung
d5e9e94741
add method to get the mutability of an AllocId
2022-08-05 17:59:35 -04:00
Ralf Jung
4e89a7c293
now we can make scalar_to_ptr a method on Scalar
2022-07-23 10:36:57 -04:00
Ralf Jung
665a7e8f56
remove some provenance-related machine hooks that Miri no longer needs
2022-07-23 10:15:37 -04:00
Ralf Jung
3dad266f40
consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable)
2022-07-20 17:12:07 -04:00
Ralf Jung
5e840c5c8c
incorporate some review feedback
2022-07-20 17:12:07 -04:00
Ralf Jung
fe00573324
make use of symbolic vtables in interpreter
2022-07-20 17:12:04 -04:00
Ralf Jung
a10d8e4581
rename get_global_alloc to try_get_global_alloc
2022-07-20 17:09:22 -04:00
Ralf Jung
da5e4d73f1
add a Vtable kind of symbolic allocations
2022-07-20 16:57:31 -04:00
Ralf Jung
0ec3269db8
interpret: rename Tag/PointerTag to Prov/Provenance
...
Let's avoid using two different terms for the same thing -- let's just call it "provenance" everywhere.
In Miri, provenance consists of an AllocId and an SbTag (Stacked Borrows tag), which made this even more confusing.
2022-07-19 15:38:32 -04:00
Dylan DPC
522d52cef7
Rollup merge of #98811 - RalfJung:interpret-alloc-range, r=oli-obk
...
Interpret: AllocRange Debug impl, and use it more consistently
The two commits are pretty independent but it did not seem worth having two PRs for them.
r? ``@oli-obk``
2022-07-05 10:42:55 +05:30
Ralf Jung
0832d1d022
more use of format! variable capture
...
Co-authored-by: Joe ST <joe@fbstj.net >
2022-07-02 13:37:24 -04:00
Ralf Jung
d31cbb5150
make AllocRef APIs more consistent
2022-07-02 11:41:16 -04:00
Ralf Jung
c36572c11e
add AllocRange Debug impl; remove redundant AllocId Display impl
2022-07-02 11:41:16 -04:00
Rémy Rakic
266bab2ab0
make get_relocations private
...
This limits access to the relocations data a bit (instead of increasing it just
for the purposes of interning).
2022-06-28 22:09:29 +02:00
Rémy Rakic
97a0b2e2d0
ctfe interning: don't walk allocations that don't need it
...
The interning of const allocations visits the mplace looking for references
to intern. Walking big aggregates like big static arrays can be costly,
so we only do it if the allocation we're interning contains references
or interior mutability.
Walking ZSTs was avoided before, and this optimization is now applied
to cases where there are no references/relocations either.
2022-06-28 22:09:28 +02:00
Ralf Jung
b094116538
interpret: refactor allocation info query
...
We now have an infallible function that also tells us which kind of allocation we are talking about.
Also we do longer have to distinguish between data and function allocations for liveness.
2022-06-26 22:49:40 -04:00