stricter lifetimes for fromref

This commit is contained in:
AF 2025-09-12 18:33:48 +00:00
parent 877f593a0d
commit 42f2653c5b
Signed by: alisa
SSH Key Fingerprint: SHA256:vNY4pdIZvO1FYJKHROkdHLtvyopizvZVAEwg9AF6h04

View File

@ -1,7 +1,8 @@
Make this compile and pass tests:
```rust
fn with_slice<T>(f: impl FnOnce(&str) -> T) -> T {
f("test")
let s = "te".to_string() + "st";
f(&s)
}
# pub trait FromRef<T: ?Sized>: for<'a> From<&'a T> { fn from_ref(value: &T) -> Self { Self::from(value) } }