Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ be taken.

E0271: r##"
This is because of a type mismatch between the associated type of some
trait (e.g. T::Bar, where T implements trait Quux { type Bar; })
and another type U that is required to be equal to T::Bar, but is not.
trait (e.g. `T::Bar`, where `T` implements `trait Quux { type Bar; }`)
and another type `U` that is required to be equal to `T::Bar`, but is not.
Examples follow.
Here is a basic example:
Expand Down
5 changes: 5 additions & 0 deletions src/librustc_resolve/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Imports (`use` statements) are not allowed after non-item statements, such as
variable declarations and expression statements.
Here is an example that demonstrates the error:
```
fn f() {
// Variable declaration before import
Expand All @@ -33,6 +34,7 @@ The solution is to declare the imports at the top of the block, function, or
file.
Here is the previous example again, with the correct order:
```
fn f() {
use std::io::Read;
Expand All @@ -52,6 +54,7 @@ The name chosen for an external crate conflicts with another external crate that
has been imported into the current module.
Wrong example:
```
extern crate a;
extern crate crate_a as a;
Expand All @@ -61,6 +64,7 @@ The solution is to choose a different name that doesn't conflict with any
external crate imported into the current module.
Correct example:
```
extern crate a;
extern crate crate_a as other_name;
Expand All @@ -71,6 +75,7 @@ E0260: r##"
The name for an item declaration conflicts with an external crate's name.
For instance,
```
extern crate abc;
Expand Down