diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2022-10-29 09:56:20 +0100 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2022-10-29 09:56:20 +0100 |
| commit | 3cddc8bff6d5357fc68a87c802a7f4fa3e1642a7 (patch) | |
| tree | 4203b0d74735994646d293cf245516d8ad7cc4de /src/test/rustdoc-js-std/parser-errors.js | |
| parent | 33b55ac39fa633d0983fad014469e1036669bf28 (diff) | |
| download | rust-3cddc8bff6d5357fc68a87c802a7f4fa3e1642a7.tar.gz rust-3cddc8bff6d5357fc68a87c802a7f4fa3e1642a7.zip | |
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.
Diffstat (limited to 'src/test/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions
