stricter lifetimes for fromref

This commit is contained in:
AF 2023-08-11 13:37:45 +00:00
parent 61971da7d2
commit b49c91de02

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) } }