Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions compiler/rustc_mir_transform/src/deduce_param_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ pub(super) fn deduced_param_attrs<'tcx>(

// Grab the optimized MIR. Analyze it to determine which arguments have been mutated.
let body: &Body<'tcx> = tcx.optimized_mir(def_id);
// Arguments spread at ABI level are currently unsupported.
if body.spread_arg.is_some() {
return &[];
}

let mut deduce = DeduceParamAttrs::new(body);
deduce.visit_body(body);
tracing::trace!(?deduce.usage);
Expand Down
10 changes: 9 additions & 1 deletion tests/codegen-llvm/deduced-param-attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//@ revisions: LLVM21 LLVM20
//@ [LLVM21] min-llvm-version: 21
//@ [LLVM20] max-llvm-major-version: 20
#![feature(custom_mir, core_intrinsics)]
#![feature(custom_mir, core_intrinsics, unboxed_closures)]
#![crate_type = "lib"]
extern crate core;
use core::intrinsics::mir::*;
Expand Down Expand Up @@ -170,3 +170,11 @@ pub fn not_captured_return_place() -> [u8; 80] {
pub fn captured_return_place() -> [u8; 80] {
black_box([0u8; 80])
}

// Arguments spread at ABI level are unsupported.
//
// CHECK-LABEL: @spread_arg(
// CHECK-NOT: readonly
// CHECK-SAME: )
#[no_mangle]
pub extern "rust-call" fn spread_arg(_: (Big, Big, Big)) {}
Loading