Skip to content

Add E0269 error explanation #30284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,41 @@ enum Method { GET, POST }
```
"##,

E0229: r##"
An associated type binding was done outside of the type parameter declaration
and `where` clause. Erroneous code example:

```
pub trait Foo {
type A;
fn boo(&self) -> <Self as Foo>::A;
}

struct Bar;

impl Foo for isize {
type A = usize;
fn boo(&self) -> usize { 42 }
}

fn baz<I>(x: &<I as Foo<A=Bar>>::A) {}
// error: associated type bindings are not allowed here
```

To solve this error, please move the type bindings in the type parameter
declaration:

```
fn baz<I: Foo<A=Bar>>(x: &<I as Foo>::A) {} // ok!
```

or in the `where` clause:

```
fn baz<I>(x: &<I as Foo>::A) where I: Foo<A=Bar> {}
```
"##,

E0261: r##"
When using a lifetime like `'a` in a type, it must be declared before being
used.
Expand Down Expand Up @@ -2241,7 +2276,6 @@ register_diagnostics! {
// E0006 // merged with E0005
// E0134,
// E0135,
E0229, // associated type bindings are not allowed here
E0278, // requirement is not satisfied
E0279, // requirement is not satisfied
E0280, // requirement is not satisfied
Expand Down