about summary refs log tree commit diff
path: root/compiler/rustc_error_codes
diff options
context:
space:
mode:
authorVeera <sveera.2001@gmail.com>2024-03-30 16:40:52 -0400
committerVeera <sveera.2001@gmail.com>2024-04-27 18:15:14 -0400
commit26ed429bab12b71891defd0f8191d2b651164f4e (patch)
tree34a691243497ed4d5d6d0912bda0acbf56314a25 /compiler/rustc_error_codes
parent70714e38f224ef1d50f3f772808fff65d7a29c0b (diff)
downloadrust-26ed429bab12b71891defd0f8191d2b651164f4e.tar.gz
rust-26ed429bab12b71891defd0f8191d2b651164f4e.zip
Mention Both HRTB and Generic Lifetime in `E0637` documentation
Also, small grammar fix.
Diffstat (limited to 'compiler/rustc_error_codes')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0637.md21
1 files changed, 17 insertions, 4 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0637.md b/compiler/rustc_error_codes/src/error_codes/E0637.md
index 62d5565df27..9c2a53f51cf 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0637.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0637.md
@@ -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: Iterator<Item = &'a u32>,
+{
+}
+
+fn without_hrtb<T>()
 where
-    T: Into<&'foo u32>,
+    T: for<'foo> Into<&'foo u32>,
 {
 }
 ```