diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-14 23:29:24 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-14 23:29:24 +0800 |
commit | 09475212bb54cb52ee35fe3cdc84401079f7469b (patch) | |
tree | b49fe2b4f41d9e8261ec3dd1b0bc9ff228f84159 /src/hir_expand | |
parent | eeb4d2f94a28909c1099bc2969cbce32343fa645 (diff) | |
download | mrust-09475212bb54cb52ee35fe3cdc84401079f7469b.tar.gz |
HIR Expand Closures - Fix `_` type in generated FnMut for Fn
Diffstat (limited to 'src/hir_expand')
-rw-r--r-- | src/hir_expand/closures.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hir_expand/closures.cpp b/src/hir_expand/closures.cpp index 2ca66da4..2cefb1fa 100644 --- a/src/hir_expand/closures.cpp +++ b/src/hir_expand/closures.cpp @@ -398,10 +398,11 @@ namespace { } // - FnMut { + auto self_ty = ::HIR::TypeRef::new_borrow( ::HIR::BorrowType::Unique, closure_type.clone() ); auto dispatch_node = NEWNODE(ret_type.clone(), CallPath, sp, ::HIR::Path(closure_type.clone(), ::HIR::GenericPath(lang_Fn, trait_params.clone()), "call"), make_vec2( - NEWNODE(method_self_ty.clone(), Borrow, sp, ::HIR::BorrowType::Shared, NEWNODE(closure_type.clone(), Deref, sp, NEWNODE(::HIR::TypeRef(), Variable, sp, "self", 0))), + NEWNODE(method_self_ty.clone(), Borrow, sp, ::HIR::BorrowType::Shared, NEWNODE(closure_type.clone(), Deref, sp, NEWNODE(mv$(self_ty), Variable, sp, "self", 0))), NEWNODE(args_ty.clone(), Variable, sp, "arg", 1) ) ); |