Skip to content

Commit f433fa4

Browse files
committedApr 15, 2025·
Auto merge of #139845 - Zalathar:rollup-u5u5y1v, r=Zalathar
Rollup of 17 pull requests Successful merges: - #138374 (Enable contracts for const functions) - #138380 (ci: add runners for vanilla LLVM 20) - #138393 (Allow const patterns of matches to contain pattern types) - #139517 (std: sys: process: uefi: Use NULL stdin by default) - #139554 (std: add Output::exit_ok) - #139660 (compiletest: Add an experimental new executor to replace libtest) - #139669 (Overhaul `AssocItem`) - #139671 (Proc macro span API redesign: Replace proc_macro::SourceFile by Span::{file, local_file}) - #139750 (std/thread: Use default stack size from menuconfig for NuttX) - #139772 (Remove `hir::Map`) - #139785 (Let CStrings be either 1 or 2 byte aligned.) - #139789 (do not unnecessarily leak auto traits in item bounds) - #139791 (drop global where-bounds before merging candidates) - #139798 (normalize: prefer `ParamEnv` over `AliasBound` candidates) - #139822 (Fix: Map EOPNOTSUPP to ErrorKind::Unsupported on Unix) - #139833 (Fix some HIR pretty-printing problems) - #139836 (Basic tests of MPMC receiver cloning) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 58c2dd9 + 783b081 commit f433fa4

File tree

173 files changed

+2498
-993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+2498
-993
lines changed
 

‎compiler/rustc_ast_lowering/src/delegation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
8585
.delegation_fn_sigs
8686
.get(&local_def_id)
8787
.is_some_and(|sig| sig.has_self),
88-
None => self.tcx.associated_item(def_id).fn_has_self_parameter,
88+
None => self.tcx.associated_item(def_id).is_method(),
8989
},
9090
_ => span_bug!(span, "unexpected DefKind for delegation item"),
9191
}

‎compiler/rustc_ast_lowering/src/expr.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,16 @@ impl<'hir> LoweringContext<'_, 'hir> {
399399
&mut self,
400400
expr: &'hir hir::Expr<'hir>,
401401
span: Span,
402-
check_ident: Ident,
403-
check_hir_id: HirId,
402+
cond_ident: Ident,
403+
cond_hir_id: HirId,
404404
) -> &'hir hir::Expr<'hir> {
405-
let checker_fn = self.expr_ident(span, check_ident, check_hir_id);
406-
let span = self.mark_span_with_reason(DesugaringKind::Contract, span, None);
407-
self.expr_call(span, checker_fn, std::slice::from_ref(expr))
405+
let cond_fn = self.expr_ident(span, cond_ident, cond_hir_id);
406+
let call_expr = self.expr_call_lang_item_fn_mut(
407+
span,
408+
hir::LangItem::ContractCheckEnsures,
409+
arena_vec![self; *cond_fn, *expr],
410+
);
411+
self.arena.alloc(call_expr)
408412
}
409413

410414
pub(crate) fn lower_const_block(&mut self, c: &AnonConst) -> hir::ConstBlock {

0 commit comments

Comments
 (0)
Please sign in to comment.