We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2442823 commit c738e60Copy full SHA for c738e60
src/librustc/diagnostics.rs
@@ -362,6 +362,10 @@ struct Foo1 { x: &bool }
362
// ^ expected lifetime parameter
363
struct Foo2<'a> { x: &'a bool } // correct
364
365
+impl Foo2 { ... }
366
+ // ^ expected lifetime parameter
367
+impl<'a> Foo2<'a> { ... } // correct
368
+
369
struct Bar1 { x: Foo2 }
370
// ^^^^ expected lifetime parameter
371
struct Bar2<'a> { x: Foo2<'a> } // correct
@@ -772,6 +776,24 @@ struct Foo<'a> {
772
776
x: &'a str,
773
777
}
774
778
```
779
780
+Implementations need their own lifetime declarations:
781
782
+```
783
+// error, undeclared lifetime
784
+impl Foo<'a> {
785
+ ...
786
+}
787
788
789
+Which are declared like this:
790
791
792
+// correct
793
+impl<'a> Foo<'a> {
794
795
796
775
797
"##,
798
799
E0262: r##"
0 commit comments