Aaron Hill

@FohtAO04T92wF-8_TVATYQ

Joined on Oct 30, 2019

  • The problem Currently, the following code compiles: fn assert_static_closure<R, F: 'static + FnOnce() -> R>(_val: F) {} fn foo<'a>() { let closure = || -> &'a str { "" }; assert_static_closure(closure); } This code creates a closure with no captures or arguments, which returns &'a str. This closure:
     Like  Bookmark
  • Never-type fallback =================== ## Background: The stabilization of the `!` ('never') type was recently attempted in https://github.com/rust-lang/rust/pull/65355, but reverted in https://github.com/rust-lang/rust/pull/67224. The reasons for the revert has to do with a relatively obscure feature of Rust known as "never-type fallback" (just "fallback" from here on out). ### What is the `!` type? Rust allows the creation of 'empty enums' with no variants (e.g. `enum Void {}`). These t
     Like  Bookmark