Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #151842 - eggyal:skip-deducing-parameter-attrs-during-ctfe, r=RalfJung
Do not deduce parameter attributes during CTFE *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/151842)* Ever since rust-lang/rust#103172, `fn_abi_of_instance` might look at a function's body to deduce certain codegen optimization attributes for its indirectly-passed parameters beyond what can be determined purely from its signature (namely today `ArgAttribute::ReadOnly` and `ArgAttribute::CapturesNone`). Since rust-lang/rust#130201, looking at a function's body in this way entails generating, for any coroutine-closures, additional by-move MIR bodies (which aren't represented in the HIR)—but this requires knowing the types of their context and consequently cycles can ensue if such bodies are generated before typeck is complete (such as during CTFE). Since they have no bearing on the evaluation result, this patch breaks a subquery out from `fn_abi_of_instance`, `fn_abi_of_instance_no_deduced_attrs`, which returns the ABI before such parameter attributes are deduced; and that new subquery is used in CTFE instead (however, since parameter attributes are only deduced in optimized builds, as a performance optimization we avoid calling the original query unless we are performing such a build). Fixes rust-lang/rust#151748 Fixes rust-lang/rust#152497
bors 7 weeks ago
parent 4a58b1e · parent 02d1ede · commit 0ba383e
0 files changed, 0 insertions, 0 deletions