Skip to content

Commit 26ed429

Browse files
Mention Both HRTB and Generic Lifetime in E0637 documentation
Also, small grammar fix.
1 parent 70714e3 commit 26ed429

File tree

1 file changed

+17
-4
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+17
-4
lines changed

compiler/rustc_error_codes/src/error_codes/E0637.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
`'_` lifetime name or `&T` without an explicit lifetime name has been used
2-
on illegal place.
2+
in an illegal place.
33

44
Erroneous code example:
55

@@ -13,7 +13,14 @@ fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str {
1313
}
1414
}
1515
16-
fn and_without_explicit_lifetime<T>()
16+
fn without_explicit_lifetime<T>()
17+
where
18+
T: Iterator<Item = &u32>,
19+
//^ `&` without an explicit lifetime name
20+
{
21+
}
22+
23+
fn without_hrtb<T>()
1724
where
1825
T: Into<&u32>,
1926
//^ `&` without an explicit lifetime name
@@ -40,9 +47,15 @@ fn underscore_lifetime<'a>(str1: &'a str, str2: &'a str) -> &'a str {
4047
}
4148
}
4249
43-
fn and_without_explicit_lifetime<'foo, T>()
50+
fn without_explicit_lifetime<'a, T>()
51+
where
52+
T: Iterator<Item = &'a u32>,
53+
{
54+
}
55+
56+
fn without_hrtb<T>()
4457
where
45-
T: Into<&'foo u32>,
58+
T: for<'foo> Into<&'foo u32>,
4659
{
4760
}
4861
```

0 commit comments

Comments
 (0)