about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorJosh White <jwhite927@gmail.com>2020-02-06 16:07:35 -0500
committerJosh White <jwhite927@gmail.com>2020-02-06 16:18:24 -0500
commit201a262ac4a9cb61e4e94d8e841a973fee0edc86 (patch)
tree4909694ba50f27965fa1b74d5309fd4e9d5dec47 /src/librustc_error_codes/error_codes
parent4a1c6ce23547346757fa8b61207aea7eb6997aa3 (diff)
Revised error long description
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0637.md28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/librustc_error_codes/error_codes/E0637.md b/src/librustc_error_codes/error_codes/E0637.md
index 4f139b0ec49..f5da357534e 100644
--- a/src/librustc_error_codes/error_codes/E0637.md
+++ b/src/librustc_error_codes/error_codes/E0637.md
@@ -1,22 +1,34 @@
-The underscore `_` character has been used as the identifier for a lifetime. 
+
+An underscore `_` character or a numeric literal `u8`, `i32`, `f64`, etc has
+been used as the identifier for a lifetime. 
 
 Erroneous code example:
 ```
-fn some_function<'_>(x: &'_ str, y: &'_ str) -> &'_ str {
+fn some_function<'_>(string1: &'_ str, string2: &'_ str) -> &'_ str {
+    //Some code
+}
+```
+or Erroneous code example 2:
+```
+fn some_function<'u8>(string1: &'u8 str, string2: &'u8 str) -> &'u8 str {
     //Some code
 }
 ```
 
-Lifetimes are named with 'ident, where ident is the name of the 
-lifetime or loop. The `_` character, which represents the ignore pattern, 
-cannot be used because it is a reserved lifetime name. 
-To fix this, use a single lowercase letter as the 
-lifetime identifier, such as `'a`. For more information, see [The Rust Book](https://doc.rust-lang.org/stable/book/appendix-02-operators.html#non-operator-symbols).
+Lifetimes are named with `'ident`, where ident is the name of the lifetime or
+loop. The `_` character, which represents the ignore pattern, cannot be used
+as the identifier because it is a reserved lifetime name. Numeric literals are
+also invalid lifetime identifiers and will cause this error to be thrown. To fix
+this, use a series of lowercase letters as the lifetime identifier. Often a
+single lowercase letter, such as `'a`, is sufficient.  For more information, see
+[the book][bk-no].
 
 Corrected code example:
 ```
-fn some_function<'a>(x: &'a str, y: &'a str) -> &'a str {
+fn some_function<'a>(string1: &'a str, string2: &'a str) -> &'a str {
     //Some code
 }
 ```
 
+[bk-no]: https://doc.rust-lang.org/book/appendix-02-operators.html#non-operator-symbols
+