Rollup merge of #148131 - tmiasko:deduce-spread-arg, r=wesleywiser
Skip parameter attribute deduction for MIR with `spread_arg` When a MIR argument is spread at ABI level, deduced attributes are potentially misapplied, since a spread argument can correspond to zero or more arguments at ABI level. Disable deduction for MIR using spread argument for the time being.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user