Skip to content

Commit 2a43b35

Browse files
committed
Rote changes that don't care to distinguish between a fn pointer and a fn item.
1 parent f460995 commit 2a43b35

File tree

23 files changed

+72
-56
lines changed

23 files changed

+72
-56
lines changed

src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ pub fn get_enum_variants<'tcx>(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::Nod
700700
item, tcx, cdata);
701701
let name = item_name(&*intr, item);
702702
let (ctor_ty, arg_tys, arg_names) = match ctor_ty.sty {
703-
ty::ty_bare_fn(ref f) =>
703+
ty::ty_bare_fn(_, ref f) =>
704704
(Some(ctor_ty), f.sig.0.inputs.clone(), None),
705705
_ => { // Nullary or struct enum variant.
706706
let mut arg_names = Vec::new();

src/librustc/middle/effect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ enum UnsafeContext {
3232

3333
fn type_is_unsafe_function(ty: Ty) -> bool {
3434
match ty.sty {
35-
ty::ty_bare_fn(ref f) => f.unsafety == ast::Unsafety::Unsafe,
35+
ty::ty_bare_fn(_, ref f) => f.unsafety == ast::Unsafety::Unsafe,
3636
ty::ty_closure(ref f) => f.unsafety == ast::Unsafety::Unsafe,
3737
_ => false,
3838
}

src/librustc/middle/fast_reject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn simplify_type(tcx: &ty::ctxt,
8383
ty::ty_closure(ref f) => {
8484
Some(FunctionSimplifiedType(f.sig.0.inputs.len()))
8585
}
86-
ty::ty_bare_fn(ref f) => {
86+
ty::ty_bare_fn(_, ref f) => {
8787
Some(FunctionSimplifiedType(f.sig.0.inputs.len()))
8888
}
8989
ty::ty_param(_) => {

src/librustc/middle/intrinsicck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct IntrinsicCheckingVisitor<'a, 'tcx: 'a> {
7474
impl<'a, 'tcx> IntrinsicCheckingVisitor<'a, 'tcx> {
7575
fn def_id_is_transmute(&self, def_id: DefId) -> bool {
7676
let intrinsic = match ty::lookup_item_type(self.tcx, def_id).ty.sty {
77-
ty::ty_bare_fn(ref bfty) => bfty.abi == RustIntrinsic,
77+
ty::ty_bare_fn(_, ref bfty) => bfty.abi == RustIntrinsic,
7878
_ => return false
7979
};
8080
if def_id.krate == ast::LOCAL_CRATE {
@@ -123,7 +123,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for IntrinsicCheckingVisitor<'a, 'tcx> {
123123
DefFn(did, _) if self.def_id_is_transmute(did) => {
124124
let typ = ty::node_id_to_type(self.tcx, expr.id);
125125
match typ.sty {
126-
ty_bare_fn(ref bare_fn_ty) if bare_fn_ty.abi == RustIntrinsic => {
126+
ty_bare_fn(_, ref bare_fn_ty) if bare_fn_ty.abi == RustIntrinsic => {
127127
if let ty::FnConverging(to) = bare_fn_ty.sig.0.output {
128128
let from = bare_fn_ty.sig.0.inputs[0];
129129
self.check_transmute(expr.span, from, to, expr.id);

src/librustc/middle/traits/select.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
795795
}
796796

797797
// provide an impl, but only for suitable `fn` pointers
798-
ty::ty_bare_fn(ty::BareFnTy {
798+
ty::ty_bare_fn(_, ty::BareFnTy {
799799
unsafety: ast::Unsafety::Normal,
800800
abi: abi::Rust,
801801
sig: ty::Binder(ty::FnSig {
@@ -984,7 +984,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
984984
ty::ty_int(_) |
985985
ty::ty_bool |
986986
ty::ty_float(_) |
987-
ty::ty_bare_fn(_) |
987+
ty::ty_bare_fn(..) |
988988
ty::ty_char => {
989989
// safe for everything
990990
Ok(If(Vec::new()))
@@ -1543,7 +1543,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
15431543

15441544
let self_ty = self.infcx.shallow_resolve(obligation.self_ty());
15451545
let sig = match self_ty.sty {
1546-
ty::ty_bare_fn(ty::BareFnTy {
1546+
ty::ty_bare_fn(_, ty::BareFnTy {
15471547
unsafety: ast::Unsafety::Normal,
15481548
abi: abi::Rust,
15491549
ref sig

src/librustc/middle/ty.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ impl FlagComputation {
21852185
self.add_tys(ts[]);
21862186
}
21872187

2188-
&ty_bare_fn(ref f) => {
2188+
&ty_bare_fn(_, ref f) => {
21892189
self.add_fn_sig(&f.sig);
21902190
}
21912191

@@ -2457,7 +2457,7 @@ pub fn maybe_walk_ty<'tcx>(ty: Ty<'tcx>, f: |Ty<'tcx>| -> bool) {
24572457
}
24582458
}
24592459
ty_tup(ref ts) => { for tt in ts.iter() { maybe_walk_ty(*tt, |x| f(x)); } }
2460-
ty_bare_fn(ref ft) => {
2460+
ty_bare_fn(_, ref ft) => {
24612461
for a in ft.sig.0.inputs.iter() { maybe_walk_ty(*a, |x| f(x)); }
24622462
if let ty::FnConverging(output) = ft.sig.0.output {
24632463
maybe_walk_ty(output, f);
@@ -2940,7 +2940,7 @@ pub fn type_contents<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> TypeContents {
29402940
// Scalar and unique types are sendable, and durable
29412941
ty_infer(ty::FreshIntTy(_)) |
29422942
ty_bool | ty_int(_) | ty_uint(_) | ty_float(_) |
2943-
ty_bare_fn(_) | ty::ty_char => {
2943+
ty_bare_fn(..) | ty::ty_char => {
29442944
TC::None
29452945
}
29462946

@@ -3275,7 +3275,7 @@ pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool {
32753275
ty_uint(_) |
32763276
ty_float(_) |
32773277
ty_str |
3278-
ty_bare_fn(_) |
3278+
ty_bare_fn(..) |
32793279
ty_closure(_) |
32803280
ty_infer(_) |
32813281
ty_err |
@@ -3810,7 +3810,7 @@ pub fn node_id_item_substs<'tcx>(cx: &ctxt<'tcx>, id: ast::NodeId) -> ItemSubsts
38103810

38113811
pub fn fn_is_variadic(fty: Ty) -> bool {
38123812
match fty.sty {
3813-
ty_bare_fn(ref f) => f.sig.0.variadic,
3813+
ty_bare_fn(_, ref f) => f.sig.0.variadic,
38143814
ty_closure(ref f) => f.sig.0.variadic,
38153815
ref s => {
38163816
panic!("fn_is_variadic() called on non-fn type: {}", s)
@@ -3820,7 +3820,7 @@ pub fn fn_is_variadic(fty: Ty) -> bool {
38203820

38213821
pub fn ty_fn_sig<'tcx>(fty: Ty<'tcx>) -> &'tcx PolyFnSig<'tcx> {
38223822
match fty.sty {
3823-
ty_bare_fn(ref f) => &f.sig,
3823+
ty_bare_fn(_, ref f) => &f.sig,
38243824
ty_closure(ref f) => &f.sig,
38253825
ref s => {
38263826
panic!("ty_fn_sig() called on non-fn type: {}", s)
@@ -3831,7 +3831,7 @@ pub fn ty_fn_sig<'tcx>(fty: Ty<'tcx>) -> &'tcx PolyFnSig<'tcx> {
38313831
/// Returns the ABI of the given function.
38323832
pub fn ty_fn_abi(fty: Ty) -> abi::Abi {
38333833
match fty.sty {
3834-
ty_bare_fn(ref f) => f.abi,
3834+
ty_bare_fn(_, ref f) => f.abi,
38353835
ty_closure(ref f) => f.abi,
38363836
_ => panic!("ty_fn_abi() called on non-fn type"),
38373837
}
@@ -3858,7 +3858,7 @@ pub fn ty_closure_store(fty: Ty) -> TraitStore {
38583858

38593859
pub fn ty_fn_ret<'tcx>(fty: Ty<'tcx>) -> FnOutput<'tcx> {
38603860
match fty.sty {
3861-
ty_bare_fn(ref f) => f.sig.0.output,
3861+
ty_bare_fn(_, ref f) => f.sig.0.output,
38623862
ty_closure(ref f) => f.sig.0.output,
38633863
ref s => {
38643864
panic!("ty_fn_ret() called on non-fn type: {}", s)
@@ -3868,7 +3868,7 @@ pub fn ty_fn_ret<'tcx>(fty: Ty<'tcx>) -> FnOutput<'tcx> {
38683868

38693869
pub fn is_fn_ty(fty: Ty) -> bool {
38703870
match fty.sty {
3871-
ty_bare_fn(_) => true,
3871+
ty_bare_fn(..) => true,
38723872
ty_closure(_) => true,
38733873
_ => false
38743874
}
@@ -6234,7 +6234,7 @@ pub fn accumulate_lifetimes_in_type(accumulator: &mut Vec<ty::Region>,
62346234
ty_str |
62356235
ty_vec(_, _) |
62366236
ty_ptr(_) |
6237-
ty_bare_fn(_) |
6237+
ty_bare_fn(..) |
62386238
ty_tup(_) |
62396239
ty_param(_) |
62406240
ty_infer(_) |

src/librustc/util/ppaux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
408408
ty_closure(ref f) => {
409409
closure_to_string(cx, &**f)
410410
}
411-
ty_bare_fn(ref f) => {
411+
ty_bare_fn(_, ref f) => {
412412
bare_fn_to_string(cx, f.unsafety, f.abi, None, &f.sig)
413413
}
414414
ty_infer(infer_ty) => infer_ty_to_string(cx, infer_ty),

src/librustc_driver/test.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,18 @@ impl<'a, 'tcx> Env<'a, 'tcx> {
253253
output_ty: Ty<'tcx>)
254254
-> Ty<'tcx>
255255
{
256-
ty::mk_ctor_fn(self.infcx.tcx, input_tys, output_ty)
256+
let input_args = input_tys.iter().map(|ty| *ty).collect();
257+
ty::mk_bare_fn(self.infcx.tcx,
258+
None,
259+
ty::BareFnTy {
260+
unsafety: ast::Unsafety::Normal,
261+
abi: abi::Rust,
262+
sig: ty::Binder(ty::FnSig {
263+
inputs: input_args,
264+
output: ty::FnConverging(output_ty),
265+
variadic: false
266+
})
267+
})
257268
}
258269

259270
pub fn t_nil(&self) -> Ty<'tcx> {

src/librustc_trans/trans/base.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ pub fn kind_for_unboxed_closure(ccx: &CrateContext, closure_id: ast::DefId)
282282
pub fn decl_rust_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
283283
fn_ty: Ty<'tcx>, name: &str) -> ValueRef {
284284
let (inputs, output, abi, env) = match fn_ty.sty {
285-
ty::ty_bare_fn(ref f) => {
285+
ty::ty_bare_fn(_, ref f) => {
286286
(f.sig.0.inputs.clone(), f.sig.0.output, f.abi, None)
287287
}
288288
ty::ty_closure(ref f) => {
@@ -956,7 +956,7 @@ pub fn trans_external_path<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
956956
did: ast::DefId, t: Ty<'tcx>) -> ValueRef {
957957
let name = csearch::get_symbol(&ccx.sess().cstore, did);
958958
match t.sty {
959-
ty::ty_bare_fn(ref fn_ty) => {
959+
ty::ty_bare_fn(_, ref fn_ty) => {
960960
match ccx.sess().target.target.adjust_abi(fn_ty.abi) {
961961
Rust | RustCall => {
962962
get_extern_rust_fn(ccx, t, name.as_slice(), did)
@@ -2015,7 +2015,7 @@ pub fn trans_named_tuple_constructor<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
20152015
let tcx = ccx.tcx();
20162016

20172017
let result_ty = match ctor_ty.sty {
2018-
ty::ty_bare_fn(ref bft) => bft.sig.0.output.unwrap(),
2018+
ty::ty_bare_fn(_, ref bft) => bft.sig.0.output.unwrap(),
20192019
_ => ccx.sess().bug(
20202020
format!("trans_enum_variant_constructor: \
20212021
unexpected ctor return type {}",
@@ -2087,7 +2087,7 @@ fn trans_enum_variant_or_tuple_like_struct<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx
20872087
let ctor_ty = ctor_ty.subst(ccx.tcx(), param_substs);
20882088

20892089
let result_ty = match ctor_ty.sty {
2090-
ty::ty_bare_fn(ref bft) => bft.sig.0.output,
2090+
ty::ty_bare_fn(_, ref bft) => bft.sig.0.output,
20912091
_ => ccx.sess().bug(
20922092
format!("trans_enum_variant_or_tuple_like_struct: \
20932093
unexpected ctor return type {}",
@@ -2422,7 +2422,7 @@ fn register_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
24222422
node_type: Ty<'tcx>)
24232423
-> ValueRef {
24242424
match node_type.sty {
2425-
ty::ty_bare_fn(ref f) => {
2425+
ty::ty_bare_fn(_, ref f) => {
24262426
assert!(f.abi == Rust || f.abi == RustCall);
24272427
}
24282428
_ => panic!("expected bare rust fn")
@@ -2439,7 +2439,7 @@ pub fn get_fn_llvm_attributes<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<
24392439

24402440
let (fn_sig, abi, has_env) = match fn_ty.sty {
24412441
ty::ty_closure(ref f) => (f.sig.clone(), f.abi, true),
2442-
ty::ty_bare_fn(ref f) => (f.sig.clone(), f.abi, false),
2442+
ty::ty_bare_fn(_, ref f) => (f.sig.clone(), f.abi, false),
24432443
ty::ty_unboxed_closure(closure_did, _, ref substs) => {
24442444
let unboxed_closures = ccx.tcx().unboxed_closures.borrow();
24452445
let ref function_type = (*unboxed_closures)[closure_did]
@@ -2468,7 +2468,7 @@ pub fn get_fn_llvm_attributes<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<
24682468
_ => ccx.sess().bug("expected tuple'd inputs")
24692469
}
24702470
},
2471-
ty::ty_bare_fn(_) if abi == RustCall => {
2471+
ty::ty_bare_fn(..) if abi == RustCall => {
24722472
let mut inputs = vec![fn_sig.0.inputs[0]];
24732473

24742474
match fn_sig.0.inputs[1].sty {

src/librustc_trans/trans/callee.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ pub use self::AutorefArg::*;
1818
pub use self::CalleeData::*;
1919
pub use self::CallArgs::*;
2020

21-
use back::abi;
21+
use arena::TypedArena;
22+
use back::{abi,link};
2223
use session;
2324
use llvm::{ValueRef};
25+
use llvm::get_param;
2426
use llvm;
2527
use metadata::csearch;
2628
use middle::def;
@@ -157,7 +159,7 @@ fn trans<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, expr: &ast::Expr)
157159
}
158160
}
159161
def::DefFn(did, _) if match expr_ty.sty {
160-
ty::ty_bare_fn(ref f) => f.abi == synabi::RustIntrinsic,
162+
ty::ty_bare_fn(_, ref f) => f.abi == synabi::RustIntrinsic,
161163
_ => false
162164
} => {
163165
let substs = node_id_substs(bcx, ExprId(ref_expr.id));
@@ -274,15 +276,16 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
274276

275277
// Construct the "tuply" version of `bare_fn_ty`. It takes two arguments: `self`,
276278
// which is the fn pointer, and `args`, which is the arguments tuple.
277-
let (input_tys, output_ty) =
279+
let (opt_def_id, input_tys, output_ty) =
278280
match bare_fn_ty.sty {
279-
ty::ty_bare_fn(ty::BareFnTy { unsafety: ast::Unsafety::Normal,
281+
ty::ty_bare_fn(opt_def_id,
282+
ty::BareFnTy { unsafety: ast::Unsafety::Normal,
280283
abi: synabi::Rust,
281284
sig: ty::Binder(ty::FnSig { inputs: ref input_tys,
282285
output: output_ty,
283286
variadic: false })}) =>
284287
{
285-
(input_tys, output_ty)
288+
(opt_def_id, input_tys, output_ty)
286289
}
287290

288291
_ => {
@@ -292,6 +295,7 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
292295
};
293296
let tuple_input_ty = ty::mk_tup(tcx, input_tys.to_vec());
294297
let tuple_fn_ty = ty::mk_bare_fn(tcx,
298+
opt_def_id,
295299
ty::BareFnTy { unsafety: ast::Unsafety::Normal,
296300
abi: synabi::RustCall,
297301
sig: ty::Binder(ty::FnSig {
@@ -654,7 +658,7 @@ pub fn trans_call_inner<'a, 'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
654658
let mut bcx = callee.bcx;
655659

656660
let (abi, ret_ty) = match callee_ty.sty {
657-
ty::ty_bare_fn(ref f) => (f.abi, f.sig.0.output),
661+
ty::ty_bare_fn(_, ref f) => (f.abi, f.sig.0.output),
658662
ty::ty_closure(ref f) => (f.abi, f.sig.0.output),
659663
_ => panic!("expected bare rust fn or closure in trans_call_inner")
660664
};

src/librustc_trans/trans/debuginfo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ impl<'tcx> TypeMap<'tcx> {
430430
trait_data.principal.substs(),
431431
&mut unique_type_id);
432432
},
433-
ty::ty_bare_fn(ty::BareFnTy{ unsafety, abi, ref sig } ) => {
433+
ty::ty_bare_fn(_, ty::BareFnTy{ unsafety, abi, ref sig } ) => {
434434
if unsafety == ast::Unsafety::Unsafe {
435435
unique_type_id.push_str("unsafe ");
436436
}
@@ -2997,7 +2997,7 @@ fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
29972997
}
29982998
}
29992999
}
3000-
ty::ty_bare_fn(ref barefnty) => {
3000+
ty::ty_bare_fn(_, ref barefnty) => {
30013001
subroutine_type_metadata(cx, unique_type_id, &barefnty.sig, usage_site_span)
30023002
}
30033003
ty::ty_closure(ref closurety) => {
@@ -3814,7 +3814,7 @@ fn push_debuginfo_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
38143814
push_item_name(cx, trait_data.principal.def_id(), false, output);
38153815
push_type_params(cx, trait_data.principal.substs(), output);
38163816
},
3817-
ty::ty_bare_fn(ty::BareFnTy{ unsafety, abi, ref sig } ) => {
3817+
ty::ty_bare_fn(_, ty::BareFnTy{ unsafety, abi, ref sig } ) => {
38183818
if unsafety == ast::Unsafety::Unsafe {
38193819
output.push_str("unsafe ");
38203820
}

src/librustc_trans/trans/foreign.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub fn trans_native_call<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
228228
ccx.tn().val_to_string(llretptr));
229229

230230
let (fn_abi, fn_sig) = match callee_ty.sty {
231-
ty::ty_bare_fn(ref fn_ty) => (fn_ty.abi, fn_ty.sig.clone()),
231+
ty::ty_bare_fn(_, ref fn_ty) => (fn_ty.abi, fn_ty.sig.clone()),
232232
_ => ccx.sess().bug("trans_native_call called on non-function type")
233233
};
234234
let llsig = foreign_signature(ccx, &fn_sig, passed_arg_tys.as_slice());
@@ -479,7 +479,7 @@ pub fn decl_rust_fn_with_foreign_abi<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
479479
let tys = foreign_types_for_fn_ty(ccx, t);
480480
let llfn_ty = lltype_for_fn_from_foreign_types(ccx, &tys);
481481
let cconv = match t.sty {
482-
ty::ty_bare_fn(ref fn_ty) => {
482+
ty::ty_bare_fn(_, ref fn_ty) => {
483483
llvm_calling_convention(ccx, fn_ty.abi)
484484
}
485485
_ => panic!("expected bare fn in decl_rust_fn_with_foreign_abi")
@@ -502,7 +502,7 @@ pub fn register_rust_fn_with_foreign_abi(ccx: &CrateContext,
502502
let llfn_ty = lltype_for_fn_from_foreign_types(ccx, &tys);
503503
let t = ty::node_id_to_type(ccx.tcx(), node_id);
504504
let cconv = match t.sty {
505-
ty::ty_bare_fn(ref fn_ty) => {
505+
ty::ty_bare_fn(_, ref fn_ty) => {
506506
llvm_calling_convention(ccx, fn_ty.abi)
507507
}
508508
_ => panic!("expected bare fn in register_rust_fn_with_foreign_abi")
@@ -556,7 +556,7 @@ pub fn trans_rust_fn_with_foreign_abi<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
556556
// Compute the type that the function would have if it were just a
557557
// normal Rust function. This will be the type of the wrappee fn.
558558
match t.sty {
559-
ty::ty_bare_fn(ref f) => {
559+
ty::ty_bare_fn(_, ref f) => {
560560
assert!(f.abi != Rust && f.abi != RustIntrinsic);
561561
}
562562
_ => {
@@ -849,7 +849,7 @@ fn foreign_types_for_id<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
849849
fn foreign_types_for_fn_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
850850
ty: Ty<'tcx>) -> ForeignTypes<'tcx> {
851851
let fn_sig = match ty.sty {
852-
ty::ty_bare_fn(ref fn_ty) => fn_ty.sig.clone(),
852+
ty::ty_bare_fn(_, ref fn_ty) => fn_ty.sig.clone(),
853853
_ => ccx.sess().bug("foreign_types_for_fn_ty called on non-function type")
854854
};
855855
let llsig = foreign_signature(ccx, &fn_sig, fn_sig.0.inputs.as_slice());

src/librustc_trans/trans/glue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
226226

227227
let fty = ty::lookup_item_type(bcx.tcx(), dtor_did).ty.subst(bcx.tcx(), substs);
228228
let self_ty = match fty.sty {
229-
ty::ty_bare_fn(ref f) => {
229+
ty::ty_bare_fn(_, ref f) => {
230230
assert!(f.sig.0.inputs.len() == 1);
231231
f.sig.0.inputs[0]
232232
}

0 commit comments

Comments
 (0)