rust/compiler/rustc_hir_analysis
Stuart Cook 380ad1b5d4
Rollup merge of #138374 - celinval:issue-136925-const-contract, r=compiler-errors,oli-obk,RalfJung
Enable contracts for const functions

Use `const_eval_select!()` macro to enable contract checking only at runtime. The existing contract logic relies on closures, which are not supported in constant functions.

This commit also removes one level of indirection for ensures clauses since we no longer build a closure around the ensures predicate.

Resolves #136925

**Call-out:** This is still a draft PR since CI is broken due to a new warning message for unreachable code when the bottom of the function is indeed unreachable. It's not clear to me why the warning wasn't triggered before.

r? ```@compiler-errors```
2025-04-15 15:47:24 +10:00
..
src Rollup merge of #138374 - celinval:issue-136925-const-contract, r=compiler-errors,oli-obk,RalfJung 2025-04-15 15:47:24 +10:00
Cargo.toml Stop relying on rustc_type_ir in non-type-system crates 2025-03-15 06:42:48 +00:00
messages.ftl Rename some name variables as ident. 2025-04-10 09:30:55 +10:00
README.md

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.