diff options
| author | bors <bors@rust-lang.org> | 2015-10-07 10:27:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-07 10:27:31 +0000 |
| commit | d454c826f3d453ccebcf3d9ccce4dabb2cccd752 (patch) | |
| tree | f95a88acd9b6d845fe90d3b54aad871a6d9c7557 | |
| parent | 0ea1305fadfe0a6946506215ea213bc43ad92d04 (diff) | |
| parent | df7d3b916d4fd2290940c8db36d80bc58b80399a (diff) | |
| download | rust-d454c826f3d453ccebcf3d9ccce4dabb2cccd752.tar.gz rust-d454c826f3d453ccebcf3d9ccce4dabb2cccd752.zip | |
Auto merge of #28865 - GuillaumeGomez:patch-1, r=Manishearth
r? @Manishearth
| -rw-r--r-- | src/librustc/diagnostics.rs | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 5ed7f4113ec..7cb2de78e2c 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -1992,6 +1992,39 @@ static A : &'static u32 = &S.a; // ok! ``` "##, +E0496: r##" +A lifetime name is shadowing another lifetime name. Erroneous code example: + +``` +struct Foo<'a> { + a: &'a i32, +} + +impl<'a> Foo<'a> { + fn f<'a>(x: &'a i32) { // error: lifetime name `'a` shadows a lifetime + // name that is already in scope + } +} +``` + +Please change the name of one of the lifetimes to remove this error. Example: + + +``` +struct Foo<'a> { + a: &'a i32, +} + +impl<'a> Foo<'a> { + fn f<'b>(x: &'b i32) { // ok! + } +} + +fn main() { +} +``` +"##, + E0497: r##" A stability attribute was used outside of the standard library. Erroneous code example: @@ -2072,7 +2105,6 @@ register_diagnostics! { E0491, // in type `..`, reference has a longer lifetime than the data it... E0492, // cannot borrow a constant which contains interior mutability E0495, // cannot infer an appropriate lifetime due to conflicting requirements - E0496, // .. name `..` shadows a .. name that is already in scope E0498, // malformed plugin attribute E0514, // metadata version mismatch } |
