File tree 1 file changed +33
-1
lines changed
1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -1992,6 +1992,39 @@ static A : &'static u32 = &S.a; // ok!
1992
1992
```
1993
1993
"## ,
1994
1994
1995
+ E0496 : r##"
1996
+ A lifetime name is shadowing another lifetime name. Erroneous code example:
1997
+
1998
+ ```
1999
+ struct Foo<'a> {
2000
+ a: &'a i32,
2001
+ }
2002
+
2003
+ impl<'a> Foo<'a> {
2004
+ fn f<'a>(x: &'a i32) { // error: lifetime name `'a` shadows a lifetime
2005
+ // name that is already in scope
2006
+ }
2007
+ }
2008
+ ```
2009
+
2010
+ Please change the name of one of the lifetimes to remove this error. Example:
2011
+
2012
+
2013
+ ```
2014
+ struct Foo<'a> {
2015
+ a: &'a i32,
2016
+ }
2017
+
2018
+ impl<'a> Foo<'a> {
2019
+ fn f<'b>(x: &'b i32) { // ok!
2020
+ }
2021
+ }
2022
+
2023
+ fn main() {
2024
+ }
2025
+ ```
2026
+ "## ,
2027
+
1995
2028
E0497 : r##"
1996
2029
A stability attribute was used outside of the standard library. Erroneous code
1997
2030
example:
@@ -2072,7 +2105,6 @@ register_diagnostics! {
2072
2105
E0491 , // in type `..`, reference has a longer lifetime than the data it...
2073
2106
E0492 , // cannot borrow a constant which contains interior mutability
2074
2107
E0495 , // cannot infer an appropriate lifetime due to conflicting requirements
2075
- E0496 , // .. name `..` shadows a .. name that is already in scope
2076
2108
E0498 , // malformed plugin attribute
2077
2109
E0514 , // metadata version mismatch
2078
2110
}
You can’t perform that action at this time.
0 commit comments