stricter lifetimes for fromref
This commit is contained in:
parent
61971da7d2
commit
b49c91de02
@ -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) } }
|
||||
|
Loading…
Reference in New Issue
Block a user