1
Fork 0
rust/compiler/rustc_interface/src
bors 3cdd0197e7 Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk
Use stable metric for const eval limit instead of current terminator-based logic

This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only.

The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made).

Also see: #103877
2023-01-29 04:11:27 +00:00
..
callbacks.rs Ignore span references from diagnostics. 2022-12-25 18:48:42 +00:00
errors.rs Warn when using panic-strategy abort for proc-macro crates 2023-01-13 10:13:49 +01:00
interface.rs Move compiler input and ouput paths into session 2023-01-16 14:46:44 +00:00
lib.rs Don't call closures immediately, use try{} blocks 2023-01-17 07:48:19 +00:00
passes.rs Compute generator saved locals on MIR. 2023-01-27 20:10:06 +00:00
proc_macro_decls.rs Simplify code 2022-11-05 17:54:06 +01:00
queries.rs Store the gctxt instead of fetching it twice. 2023-01-23 10:35:21 +00:00
tests.rs Replace terminator-based const eval limit 2023-01-23 23:56:22 +00:00
util.rs Move compiler input and ouput paths into session 2023-01-16 14:46:44 +00:00