Michael Goulet 4b668a1fee
Rollup merge of #103718 - matklad:infer-lazy, r=dtolnay
More inference-friendly API for lazy

The signature for new was

```
fn new<F>(f: F) -> Lazy<T, F>
```

Notably, with `F` unconstrained, `T` can be literally anything, and just `let _ = Lazy::new(|| 92)` would not typecheck.

This historiacally was a necessity -- `new` is a `const` function, it couldn't have any bounds. Today though, we can move `new` under the `F: FnOnce() -> T` bound, which gives the compiler enough data to infer the type of T from closure.
2022-12-27 12:33:33 -08:00
..
2022-11-08 17:39:40 +01:00
2022-10-08 11:48:53 +00:00
2022-07-13 17:07:41 -07:00
2022-05-20 11:04:13 -03:00
2022-05-22 07:18:32 -03:00
2022-05-20 11:16:30 -07:00
2022-02-25 08:00:52 -05:00
2022-10-29 09:56:20 +01:00
2022-11-06 17:21:21 -05:00
2022-09-27 19:23:52 +00:00
2022-11-20 11:19:11 -05:00
2022-08-20 12:49:20 -04:00
2022-09-14 14:53:16 +02:00
2022-07-08 21:18:15 +00:00
2022-06-27 13:30:44 -04:00