bors
0fd7ce99b0
Auto merge of #116010 - RalfJung:more-typed-immediates, r=oli-obk
...
interpret: more consistently use ImmTy in operators and casts
The diff in src/tools/miri/src/shims/x86/sse2.rs should hopefully suffice to explain why this is nicer. :)
2023-09-21 14:02:55 +00:00
Ralf Jung
da08a3f40c
interpret: more consistently use ImmTy in operators and casts
2023-09-20 21:57:54 +02:00
Ralf Jung
ea22adbabd
adjust constValue::Slice to work for arbitrary slice types
2023-09-19 20:17:43 +02:00
Ralf Jung
5a0a1ff0cd
move ConstValue into mir
...
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-19 11:11:02 +02:00
Ralf Jung
89ac57db4d
move required_consts check to general post-mono-check function
2023-09-14 22:30:42 +02:00
bors
e437e57954
Auto merge of #115804 - RalfJung:valtree-to-const-val, r=oli-obk
...
consistently pass ty::Const through valtrees
Some drive-by things extracted from https://github.com/rust-lang/rust/pull/115748 .
2023-09-14 15:34:31 +00:00
Ralf Jung
7aa44eee99
don't force all slice-typed ConstValue to be ConstValue::Slice
2023-09-14 11:56:55 +02:00
Ralf Jung
06947be196
valtree_to_const_value: add fast-path for Scalar tuples/structs
2023-09-14 07:40:05 +02:00
Ralf Jung
0f8908da27
cleanup op_to_const a bit; rename ConstValue::ByRef → Indirect
2023-09-14 07:27:30 +02:00
Ralf Jung
551f481ffb
use AllocId instead of Allocation in ConstValue::ByRef
2023-09-14 07:26:24 +02:00
Ralf Jung
3aedb85a27
a bit of cleanup in valtree_to_const_value
2023-09-14 07:22:44 +02:00
Ralf Jung
fd91dfb494
cleanup leftovers of const_err lint
2023-09-12 13:41:42 +02:00
Ralf Jung
fa5f13775a
interpret: make MemPlace, Place, Operand types private to the interpreter
2023-09-04 17:53:38 +02:00
Ralf Jung
a09df43d9f
move marking-locals-live out of push_stack_frame, so it happens with argument passing
...
this entirely avoids even creating unsized locals in Immediate::Uninitialized state
2023-08-30 13:46:54 +02:00
Ralf Jung
807e5b8022
avoid return in tail position
...
Co-authored-by: fee1-dead <ent3rm4n@gmail.com>
2023-08-20 15:52:40 +02:00
Ralf Jung
ac3bca24b7
interpret: have assert_* intrinsics call the panic machinery instead of a direct abort
2023-08-20 15:52:40 +02:00
Ralf Jung
410bd45ff2
const-eval: ensure we never const-execute a function marked rustc_do_not_const_check
2023-08-19 14:33:31 +02:00
bors
f88a8b71ce
Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obk
...
correctly lower `impl const` to bind to host effect param
r? `@oli-obk`
2023-08-08 19:23:41 +00:00
Ralf Jung
997ec63fb1
simplify handling of valtrees for unsized types
2023-08-06 21:25:49 +02:00
Ralf Jung
b6e3bc23ef
remove an unnecessary special case in valtree_into_mplace
2023-08-06 21:25:49 +02:00
Deadbeef
92f4c59e48
lower impl const to bind to host effect param
2023-08-06 13:34:53 +00:00
Ralf Jung
7d5886504c
rename deref_operand → deref_pointer and some Miri helper functions
2023-08-01 13:40:29 +02:00
Matthias Krüger
5dee519386
Rollup merge of #113773 - compiler-errors:err-layout-bail, r=cjgillot
...
Don't attempt to compute layout of type referencing error
Leads to more ICEs and strange diagnostics than are worth it.
Fixes #113760
2023-07-29 06:13:05 +02:00
Michael Goulet
d45eb41c50
Dont report CTFE errors that are due to references-error layouts
2023-07-27 18:51:44 +00:00
Deadbeef
b0fa2201d3
bless clippy
2023-07-27 17:56:25 +00:00
Deadbeef
e6b423aebb
Remove constness
from ParamEnv
2023-07-27 15:50:42 +00:00
Matthias Krüger
fa21a8c6f8
Rollup merge of #114075 - matthiaskrgr:fmt_args_rustc_3, r=wesleywiser
...
inline format!() args from rustc_codegen_llvm to the end (4)
r? `@WaffleLapkin`
2023-07-27 06:04:13 +02:00
Ralf Jung
571e8ce777
valtree: a bit of cleanup
2023-07-26 11:45:35 +02:00
Matthias Krüger
c64ef5e070
inline format!() args from rustc_codegen_llvm to the end (4)
...
r? @WaffleLapkin
2023-07-25 23:20:28 +02:00
Ralf Jung
da3f0d0eb7
make MPlaceTy non-Copy
2023-07-25 22:35:07 +02:00
Ralf Jung
77ff1b83cd
interpret: make read functions generic over operand type
2023-07-25 22:33:59 +02:00
Ralf Jung
00fb45dccd
interpret: make write functions generic over the place type
2023-07-25 22:33:58 +02:00
Ralf Jung
14a674c88c
interpret: read_discriminant: only return VariantIdx
2023-07-25 14:30:58 +02:00
Ralf Jung
a2bcafa500
interpret: refactor projection code to work on a common trait, and use that for visitors
2023-07-25 14:30:58 +02:00
David Tolnay
5bbf0a8306
Revert "Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk"
...
This reverts commit 557359f925
, reversing
changes made to 1e6c09a803
.
2023-07-21 22:35:57 -07:00
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
Mahdi Dibaiee
e55583c4b8
refactor(rustc_middle): Substs -> GenericArg
2023-07-14 13:27:35 +01:00
Mark Rousskov
cc907f80b9
Re-format let-else per rustfmt update
2023-07-12 21:49:27 -04:00
Ralf Jung
dd453a6a99
miri: protect Move() function arguments during the call
2023-07-11 21:59:01 +02:00
Oli Scherer
8ac1a67d11
Name the destructure_mir_constant query appropriately
2023-07-05 15:54:43 +00:00
Oli Scherer
46cce98134
Use options instead of errors if the errors are never needed
2023-07-05 15:54:43 +00:00
Oli Scherer
a0eb348d38
Specialize DestructuredConstant
to its one user (pretty printing)
2023-07-05 15:54:43 +00:00
Oli Scherer
4dcf988360
Specialize try_destructure_mir_constant
for its sole user
2023-07-05 15:54:43 +00:00
Oli Scherer
168de14ac9
Make simd_shuffle_indices use valtrees
2023-06-26 09:34:52 +00:00
Nilstrieb
70b6a74c3c
Add enum for can_access_statics
boolean
...
`/*can_access_statics:*/ false` is one of the ways to do this, but not
the one I like.
2023-06-24 20:40:40 +00:00
Deadbeef
4f83717cf7
Use translatable diagnostics in rustc_const_eval
2023-06-01 14:45:18 +00:00
bors
23f93a1266
Auto merge of #103877 - oli-obk:const_eval_step_limit, r=fee1-dead
...
Replace const eval limit by a lint and add an exponential backoff warning
The lint triggers at the first power of 2 that comes after 1 million function calls or traversed back-edges (takes less than a second on usual programs). After the first emission, an unsilenceable warning is repeated at every following power of 2 terminators, causing it to get reported less and less the longer the evaluation runs.
cc `@rust-lang/wg-const-eval`
fixes #93481
closes #67217
2023-06-01 05:32:00 +00:00
Oli Scherer
aa3a1862ba
Remove deref_mir_constant
2023-05-31 14:07:15 +00:00
Oli Scherer
05eae08233
Remove const eval limit and implement an exponential backoff lint instead
2023-05-31 10:24:17 +00:00