Mention Both HRTB and Generic Lifetime in E0637
documentation
Also, small grammar fix.
This commit is contained in:
parent
70714e38f2
commit
26ed429bab
1 changed files with 17 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
`'_` lifetime name or `&T` without an explicit lifetime name has been used
|
||||
on illegal place.
|
||||
in an illegal place.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
|
@ -13,7 +13,14 @@ fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str {
|
|||
}
|
||||
}
|
||||
|
||||
fn and_without_explicit_lifetime<T>()
|
||||
fn without_explicit_lifetime<T>()
|
||||
where
|
||||
T: Iterator<Item = &u32>,
|
||||
//^ `&` without an explicit lifetime name
|
||||
{
|
||||
}
|
||||
|
||||
fn without_hrtb<T>()
|
||||
where
|
||||
T: Into<&u32>,
|
||||
//^ `&` without an explicit lifetime name
|
||||
|
@ -40,9 +47,15 @@ fn underscore_lifetime<'a>(str1: &'a str, str2: &'a str) -> &'a str {
|
|||
}
|
||||
}
|
||||
|
||||
fn and_without_explicit_lifetime<'foo, T>()
|
||||
fn without_explicit_lifetime<'a, T>()
|
||||
where
|
||||
T: Into<&'foo u32>,
|
||||
T: Iterator<Item = &'a u32>,
|
||||
{
|
||||
}
|
||||
|
||||
fn without_hrtb<T>()
|
||||
where
|
||||
T: for<'foo> Into<&'foo u32>,
|
||||
{
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue