Skip to content

Commit e8c5b73

Browse files
committed
drive-by: remove ClosureArgs.tupled_sig
Neither hax nor charon use it and it's potentially confusing.
1 parent 7365d54 commit e8c5b73

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

engine/lib/import_thir.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,10 +1018,8 @@ end) : EXPR = struct
10181018
| Float k ->
10191019
TFloat
10201020
(match k with F16 -> F16 | F32 -> F32 | F64 -> F64 | F128 -> F128)
1021-
| Arrow signature
1022-
| Closure { untupled_sig = signature; _ }
1023-
| FnDef { fn_sig = signature; _ } ->
1024-
let ({ inputs; output; _ } : Thir.ty_fn_sig) = signature.value in
1021+
| Arrow fn_sig | Closure { fn_sig; _ } | FnDef { fn_sig; _ } ->
1022+
let ({ inputs; output; _ } : Thir.ty_fn_sig) = fn_sig.value in
10251023
let inputs =
10261024
if List.is_empty inputs then [ U.unit_typ ]
10271025
else List.map ~f:(c_ty span) inputs

frontend/exporter/src/types/mir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ fn translate_terminator_kind_call<'tcx, S: BaseState<'tcx> + HasMir<'tcx> + HasO
373373
let sig = match hax_ty.kind() {
374374
TyKind::Arrow(sig) => sig,
375375
TyKind::FnDef { fn_sig, .. } => fn_sig,
376-
TyKind::Closure(args) => &args.untupled_sig,
376+
TyKind::Closure(args) => &args.fn_sig,
377377
_ => supposely_unreachable_fatal!(
378378
s,
379379
"TerminatorKind_Call_expected_fn_type";

frontend/exporter/src/types/ty.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,11 +1353,8 @@ pub struct ClosureArgs {
13531353
/// The base kind of this closure. The kinds are ordered by inclusion: any `Fn` works as an
13541354
/// `FnMut`, and any `FnMut` works as an `FnOnce`.
13551355
pub kind: ClosureKind,
1356-
/// The proper `fn(A, B, C) -> D` signature of the closure.
1357-
pub untupled_sig: PolyFnSig,
1358-
/// The signature of the closure as one input and one output, where the input arguments are
1359-
/// tupled. This is relevant to implementing the `Fn*` traits.
1360-
pub tupled_sig: PolyFnSig,
1356+
/// The signature of the function that the closure implements, e.g. `fn(A, B, C) -> D`.
1357+
pub fn_sig: PolyFnSig,
13611358
/// The set of captured variables. Together they form the state of the closure.
13621359
pub upvar_tys: Vec<Ty>,
13631360
}
@@ -1384,8 +1381,7 @@ impl ClosureArgs {
13841381
ClosureArgs {
13851382
item,
13861383
kind: from.kind().sinto(s),
1387-
tupled_sig: sig.sinto(s),
1388-
untupled_sig: tcx
1384+
fn_sig: tcx
13891385
.signature_unclosure(sig, rustc_hir::Safety::Safe)
13901386
.sinto(s),
13911387
upvar_tys: from.upvar_tys().sinto(s),

0 commit comments

Comments
 (0)