From 58d0e67f504fb55ccbe1094265d029a10bc168c7 Mon Sep 17 00:00:00 2001 From: Josh White Date: Sat, 8 Feb 2020 06:18:42 -0500 Subject: Added compiler flags to example code, removed unexpected curly --- src/librustc_error_codes/error_codes/E0637.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/librustc_error_codes/error_codes') diff --git a/src/librustc_error_codes/error_codes/E0637.md b/src/librustc_error_codes/error_codes/E0637.md index f2ec7fa0b49..9b5db8fe733 100644 --- a/src/librustc_error_codes/error_codes/E0637.md +++ b/src/librustc_error_codes/error_codes/E0637.md @@ -2,7 +2,7 @@ An underscore `_` character has been used as the identifier for a lifetime, or a const generic has been borrowed without an explicit lifetime. Erroneous example with an underscore: -``` +```compile_fail,E0106,E0637 fn foo<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str {} // ^^ `'_` is a reserved lifetime name ``` @@ -19,7 +19,7 @@ fn <'a>(str1: &'a str, str2: &'a str) -> &'a str {} ``` Erroneous example with const generic: -``` +```compile_fail,E0637 struct A; //~^ ERROR `&` without an explicit lifetime name cannot be used here trait B {} @@ -35,7 +35,6 @@ impl B for A {} fn bar() {} //~^ ERROR `&` without an explicit lifetime name cannot be used here -} ``` Const generics cannot be borrowed without specifying a lifetime.The @@ -56,6 +55,5 @@ impl A { impl B for A {} fn bar() {} -} ``` [bk-no]: https://doc.rust-lang.org/book/appendix-02-operators.html#non-operator-symbols -- cgit 1.4.1-3-g733a5