X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fdiagnostics.rs;h=412759e11423e94ed22176988b06ba484b1833e7;hb=eb8f2586ebd842dec49d3d7f50e49a985ab31493;hp=522c1531c593804228a9bbad830df4d7756ef6d0;hpb=c2009536acd2a0fb6277d7b6d9a835d17cab97ca;p=rust.git diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 522c1531c59..412759e1142 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -362,6 +362,10 @@ enum Enum { struct Foo { x: &bool } // error struct Foo<'a> { x: &'a bool } // correct +struct Bar { x: Foo } + ^^^ expected lifetime parameter +struct Bar<'a> { x: Foo<'a> } // correct + enum Bar { A(u8), B(&bool), } // error enum Bar<'a> { A(u8), B(&'a bool), } // correct @@ -683,6 +687,21 @@ fn foo(x: Vec) { See also https://doc.rust-lang.org/book/first-edition/no-stdlib.html "##, +E0214: r##" +A generic type was described using parentheses rather than angle brackets. For +example: + +```compile_fail,E0214 +fn main() { + let v: Vec(&str) = vec!["foo"]; +} +``` + +This is not currently supported: `v` should be defined as `Vec<&str>`. +Parentheses are currently only used with generic types when defining parameters +for `Fn`-family traits. +"##, + E0261: r##" When using a lifetime like `'a` in a type, it must be declared before being used.