rust/compiler/rustc_const_eval/src/interpret
bors c872a1418a Auto merge of #125507 - compiler-errors:type-length-limit, r=lcnr
Re-implement a type-size based limit

r? lcnr

This PR reintroduces the type length limit added in #37789, which was accidentally made practically useless by the caching changes to `Ty::walk` in #72412, which caused the `walk` function to no longer walk over identical elements.

Hitting this length limit is not fatal unless we are in codegen -- so it shouldn't affect passes like the mir inliner which creates potentially very large types (which we observed, for example, when the new trait solver compiles `itertools` in `--release` mode).

This also increases the type length limit from `1048576 == 2 ** 20` to `2 ** 24`, which covers all of the code that can be reached with craterbot-check. Individual crates can increase the length limit further if desired.

Perf regression is mild and I think we should accept it -- reinstating this limit is important for the new trait solver and to make sure we don't accidentally hit more type-size related regressions in the future.

Fixes #125460
2024-07-03 11:56:36 +00:00
..
cast.rs Enable const casting for f16 and f128 2024-06-27 04:36:29 -05:00
discriminant.rs chore: remove duplicate words 2024-07-02 11:25:31 +08:00
eval_context.rs Instance::resolve -> Instance::try_resolve, and other nits 2024-07-02 17:28:03 -04:00
intern.rs rename CompileTimeInterpreter -> CompileTimeMachine, CompileTimeEvalContext -> CompileTimeInterpCx 2024-06-13 20:30:11 +02:00
intrinsics.rs Rollup merge of #126232 - RalfJung:dyn-trait-equality, r=oli-obk 2024-06-12 15:44:59 +02:00
machine.rs Rename InstanceDef -> InstanceKind 2024-06-16 21:35:21 -04:00
memory.rs add as_ptr to trait AllocBytes, fix 2 impls; add pub fn get_bytes_unchecked_raw in allocation.rs; add pub fn get_alloc_bytes_unchecked_raw[_mut] in memory.rs 2024-06-21 12:50:24 +02:00
mod.rs interpret: hide some reexports in rustdoc 2024-05-02 18:47:36 +02:00
operand.rs ScalarInt: size mismatches are a bug, do not delay the panic 2024-06-10 13:43:16 +02:00
operator.rs More GVN for PtrMetadata 2024-06-20 22:16:59 -07:00
place.rs interpret: use trace to reduce noice 2024-06-21 13:51:33 +00:00
projection.rs don't ICE when encountering an extern type field during validation 2024-06-22 17:39:01 +02:00
step.rs offset_of: allow (unstably) taking the offset of slice tail fields 2024-06-08 18:17:55 +02:00
terminator.rs Fix spans 2024-07-02 15:48:48 -04:00
traits.rs interpret: dyn trait metadata check: equate traits in a proper way 2024-06-11 08:54:49 +02:00
util.rs Rename InstanceDef -> InstanceKind 2024-06-16 21:35:21 -04:00
validity.rs don't ICE when encountering an extern type field during validation 2024-06-22 17:39:01 +02:00
visitor.rs interpret: refactor dyn trait handling 2024-06-10 17:28:52 +02:00