File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 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!
19921992```
19931993"## ,
19941994
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+
19952028E0497 : r##"
19962029A stability attribute was used outside of the standard library. Erroneous code
19972030example:
@@ -2072,7 +2105,6 @@ register_diagnostics! {
20722105 E0491 , // in type `..`, reference has a longer lifetime than the data it...
20732106 E0492 , // cannot borrow a constant which contains interior mutability
20742107 E0495 , // cannot infer an appropriate lifetime due to conflicting requirements
2075- E0496 , // .. name `..` shadows a .. name that is already in scope
20762108 E0498 , // malformed plugin attribute
20772109 E0514 , // metadata version mismatch
20782110}
You can’t perform that action at this time.
0 commit comments