@@ -33,7 +33,7 @@ use crate::{
3333 reify:: unwrap_closure_type,
3434} ;
3535
36- /// Constructs a `&'static [Symbol<'static> ]` path from `::` separated segments.
36+ /// Constructs a `&'static [ConstantSymbol ]` path from `::` separated segments.
3737///
3838/// Each segment maps to the corresponding `sym::` constant.
3939///
@@ -315,7 +315,7 @@ impl<'syn, A: Allocator, S: Allocator> SyntheticBuilder<'syn, '_, '_, '_, '_, '_
315315 }
316316
317317 fn build_binary ( & mut self , name : ConstantSymbol , op : BinOp ) -> ( TypeId , DefId ) {
318- let closure_type_id = self
318+ let mut closure_type_id = self
319319 . context
320320 . hir
321321 . map
@@ -325,6 +325,7 @@ impl<'syn, A: Allocator, S: Allocator> SyntheticBuilder<'syn, '_, '_, '_, '_, '_
325325 // Thunking wraps the qualified variable type as `() -> ClosureType`.
326326 // If we see a no-arg closure, unwrap its return type to get the actual signature.
327327 let closure_type = if closure_type. params . is_empty ( ) {
328+ closure_type_id = closure_type. returns ;
328329 unwrap_closure_type ( closure_type. returns , self . context . mir . env )
329330 } else {
330331 closure_type
@@ -416,7 +417,7 @@ impl<'syn, A: Allocator, S: Allocator> SyntheticBuilder<'syn, '_, '_, '_, '_, '_
416417 }
417418
418419 fn build_unary ( & mut self , name : ConstantSymbol , op : UnOp ) -> ( TypeId , DefId ) {
419- let closure_type_id = self
420+ let mut closure_type_id = self
420421 . context
421422 . hir
422423 . map
@@ -426,6 +427,7 @@ impl<'syn, A: Allocator, S: Allocator> SyntheticBuilder<'syn, '_, '_, '_, '_, '_
426427 // Thunking wraps the qualified variable type as `() -> ClosureType`.
427428 // If we see a no-arg closure, unwrap its return type to get the actual signature.
428429 let closure_type = if closure_type. params . is_empty ( ) {
430+ closure_type_id = closure_type. returns ;
429431 unwrap_closure_type ( closure_type. returns , self . context . mir . env )
430432 } else {
431433 closure_type
0 commit comments