about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-12-27 12:33:33 -0800
committerGitHub <noreply@github.com>2022-12-27 12:33:33 -0800
commit4b668a1feed45b3061fbf0d1d42fb1a695c0d4b3 (patch)
tree68ccf98bcfa2d79d78ae0fbe27a4a505a056b1c2 /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentdb7962532610cfbfb9be17e8d6c1b48acf5ed184 (diff)
parent3cddc8bff6d5357fc68a87c802a7f4fa3e1642a7 (diff)
downloadrust-4b668a1feed45b3061fbf0d1d42fb1a695c0d4b3.tar.gz
rust-4b668a1feed45b3061fbf0d1d42fb1a695c0d4b3.zip
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.
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions