Skip to content

Commit

Permalink
Replace example and message by @Manisheart proposition
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 23, 2015
1 parent 67c11b0 commit e52b94e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,15 @@ E0044: r##"
You can't use type parameters on foreign items. Example of erroneous code:
```
extern { fn some_func<T>(); }
extern { fn some_func<T>(x: T); }
```
Just remove the type parameter to make this code works:
To fix this, replace the type parameter with the specializations that you
need:
```
extern { fn some_func(); }
extern { fn some_func_i32(x: i32); }
extern { fn some_func_i64(x: i64); }
```
E0045: r##"
Expand Down Expand Up @@ -754,7 +756,7 @@ Example of erroneous code:
enum Foo { f };
let u = Foo::f { value: 0i32 }; // error: Foo:f isn't a structure!
// or even more simple:
// or even simpler:
let u = t { random_field: 0i32 }; //error: t isn't a structure!
```
Expand All @@ -772,7 +774,7 @@ enum Foo {
fn main() {
let u = Foo::f(Inner { value: 0i32 });
// or even more simple:
// or even simpler:
let t = Inner { value: 0i32 };
}
```
Expand Down Expand Up @@ -1533,9 +1535,6 @@ For more information see the [opt-in builtin traits RFC](https://github.com/rust
}

register_diagnostics! {
E0034, // multiple applicable methods in scope
E0035, // does not take type parameters
E0036, // incorrect number of type parameters given for this method
E0068,
E0074,
E0075,
Expand Down

0 comments on commit e52b94e

Please sign in to comment.