about summary refs log tree commit diff
path: root/src/test/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2022-10-29 09:56:20 +0100
committerAleksey Kladov <aleksey.kladov@gmail.com>2022-10-29 09:56:20 +0100
commit3cddc8bff6d5357fc68a87c802a7f4fa3e1642a7 (patch)
tree4203b0d74735994646d293cf245516d8ad7cc4de /src/test/rustdoc-js-std/parser-errors.js
parent33b55ac39fa633d0983fad014469e1036669bf28 (diff)
downloadrust-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