mirror of https://github.com/rust-lang/reference
Update lifetime-elision.md
This commit is contained in:
parent
9329dc4ae6
commit
8c6c7cdc2b
|
@ -182,10 +182,10 @@ usual rules, then it will error. By way of example:
|
|||
# struct Bar;
|
||||
# struct Baz;
|
||||
# fn somefunc(a: &Foo, b: &Bar, c: &Baz) -> usize {42}
|
||||
// Resolved as `fn<'a>(&'a str) -> &'a str`.
|
||||
// Resolved as `for<'a> fn(&'a str) -> &'a str`.
|
||||
const RESOLVED_SINGLE: fn(&str) -> &str = |x| x;
|
||||
|
||||
// Resolved as `Fn<'a, 'b, 'c>(&'a Foo, &'b Bar, &'c Baz) -> usize`.
|
||||
// Resolved as `for<'a, 'b, 'c> Fn(&'a Foo, &'b Bar, &'c Baz) -> usize`.
|
||||
const RESOLVED_MULTIPLE: &dyn Fn(&Foo, &Bar, &Baz) -> usize = &somefunc;
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue