Closed
Description
This is a metabug for tracking work remaining to be done on unboxed closures. It contains only the high-level remaining issues. For a comprehensive list of closure bugs, search using the A-closures label.
1.0 Issues
- Trait selection treats unboxed closure arguments as quasi-associated types #20872 -- Make
Fn
traits be treated like everything in trait selection - ICE using parenthetical trait notation in impls #19982 -- ICE using parenthetical notation in impls
- Unexplained lifetime error in closure type #11740 -- Unexplained lifetime error in closure type
- Unable to manually implement FnOnce #18835 -- Unable to manually implement
FnOnce
- FnMut not implemented for mutable FnMut implementors #23015 -- Impl
FnMut
for&mut F
whereF: FnMut
Completed issues
- Make return type of the
Fn
traits an associated type #20871 -- Make return type of theFn
traits an associated type - Cannot move from individual upvars in a by-ref once closure #21603 -- Allow individual upvars to be moved
- Closure kind inference: infer whether a closure is
Fn
,FnMut
, etc #16640 -- Implement unboxed closure upvar inference - Unboxed closure: infer
move
when passing an unboxed closure to Fn* + Send #18799 -- Infermove
usingSend
trait -
|&mut:|
wants (Copy
) upvar to be mutable when it shouldn't #16749 --|&mut:|
wants (Copy
) upvar to be mutable when it shouldn't - Bad type inference error message with unboxed closures #17881 -- Bad type inference error message with unboxed closures
- Finalize unboxed closure feature gates for 1.0 #18875 -- Adjust feature gates
- Lifetimes in closure return values are inferred to be 'static, unlike with functions #17908 -- clarify lifetimes in closure return type syntax
- by-ref closure capture semantics are a backwards compatibility hazard #12831 -- by-ref closure capture semantics are a backwards compatibility hazard
- Implement higher-ranked trait bounds #17661 -- Implement higher-ranked trait bounds
- Remove old (boxed) closures from the language #14798 -- Remove old (boxed) closures from the language
- Fn trait hierarchy not respected #18387 -- Fn trait hierarchy not respected
- Parentheses notation should respect lifetime elision #18992 -- Parentheses notation should support lifetime elision
- Unboxed closure types are implicitly copyable #19817 -- unboxed closures should not be implicitly copyable
- Unboxed closure trait references should pretty print with parenthesized notation #19836 -- should pretty-print with parenthesized notation
- HRTB rules do not permit "perfect forwarding" of the
Fn
traits #19730 -- "perfect forwarding" traits are not accepted by HRTB - ICE on generic type inference failure for unboxed closures #17551 -- ICE on generic type inference failure for unboxed closures
- ICE using explicit lifetime with unboxed closures #17545 -- ICE using explicit lifetime with unboxed closures
- ICE fictitious type O in sizing_type_of() #17060 -- ICE fictitious type O in sizing_type_of()
- ICE when using unboxed closures #17021 -- ICE when using unboxed closures
- ICE calling an unboxed closure with the wrong number of parameters inside another closure #16939 -- ICE calling an unboxed closure with the wrong number of parameters inside another closure
- Unboxed closures ICE when debug println!()d #16808 -- Unboxed closures ICE when debug println!()d
- Internal compiler error related to sizing of unboxes closures #16791 -- ICE related to sizing of unboxes closures
- Internal compiler error in metadata::tydecode::parse_def_id related to unboxes closures #16790 -- ICE in metadata::tydecode::parse_def_id related to unboxes closures
- Running into segmentation fault with new closures #16774 -- Running into segmentation fault with new closures
- ICE: When creating Box<FnOnce<(), ()>> from unsugared unboxed closure #16739 -- ICE: When creating Box<FnOnce<(), ()>> from unsugared unboxed closure
- ICE returning unboxed closure #16672 -- ICE returning unboxed closure
- internal compiler error #18057 -- internal compiler error
- Unboxed closure ICE: cannot relate bound region: ReInfer(16) <= ReLateBound #17816 -- Unboxed closure ICE: cannot relate bound region: ReInfer(16) <= ReLateBound
- Unboxed closures ICE: Expected(expected EBML doc with tag EsEnumVid but found tag 27) #18378 -- Unboxed closures ICE: Expected(expected EBML doc with tag EsEnumVid but found tag 27)
- Unboxed closure + traits bug #18453 -- Unboxed closures and traits ICE
- ICE with lifetimes and associated types #20582 -- normalization failure in return type in impl
- Aliasing rules are broken for closures #17403 -- Aliasing rules are broken for closures
- Struct + Fn fulfills
Send
, but sugary version|&: ...|
does not #16560 -- Struct + Fn fulfillsSend
, but sugary version|&: ...|
does not - Cannot call a unboxed-closure trait object with () syntax #16929 -- Cannot call a unboxed-closure trait object with () syntax
- Overloaded call notation doesn't work with trait bounds #18385 -- Overloaded call notation doesn't work with trait bounds
- Unboxed closures:
ref
-prefixed closures still capture by value #16814 -- Unboxed closures:ref
-prefixed closures still capture by value - Unboxed closures: cannot borrow data mutably in aliasable location #16668 -- Unboxed closures: cannot borrow data mutably in aliasable location
- Function pointers should implement the various Fn* types #17961 -- Function pointers should implement the various Fn* types
- Unboxed closures: Type inferencer failed to detect closure argument types #17907 -- Unboxed closures: Type inferencer failed to detect closure argument types
- unboxed closure sugar not working in trait objects #17703 -- unboxed closure sugar not working in trait objects
-
Box<Fn(int) -> int + 'static>
is not accepted: "explicit lifetime bound required" #18772 --Box<Fn() + 'static>
not accepted