Skip to content

Commit 06b084f

Browse files
committed
Markdown formatting for error explanations.
1 parent dd9dcc1 commit 06b084f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/librustc/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ be taken.
427427

428428
E0271: r##"
429429
This is because of a type mismatch between the associated type of some
430-
trait (e.g. T::Bar, where T implements trait Quux { type Bar; })
431-
and another type U that is required to be equal to T::Bar, but is not.
430+
trait (e.g. `T::Bar`, where `T` implements `trait Quux { type Bar; }`)
431+
and another type `U` that is required to be equal to `T::Bar`, but is not.
432432
Examples follow.
433433
434434
Here is a basic example:

src/librustc_resolve/diagnostics.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Imports (`use` statements) are not allowed after non-item statements, such as
2020
variable declarations and expression statements.
2121
2222
Here is an example that demonstrates the error:
23+
2324
```
2425
fn f() {
2526
// Variable declaration before import
@@ -33,6 +34,7 @@ The solution is to declare the imports at the top of the block, function, or
3334
file.
3435
3536
Here is the previous example again, with the correct order:
37+
3638
```
3739
fn f() {
3840
use std::io::Read;
@@ -52,6 +54,7 @@ The name chosen for an external crate conflicts with another external crate that
5254
has been imported into the current module.
5355
5456
Wrong example:
57+
5558
```
5659
extern crate a;
5760
extern crate crate_a as a;
@@ -61,6 +64,7 @@ The solution is to choose a different name that doesn't conflict with any
6164
external crate imported into the current module.
6265
6366
Correct example:
67+
6468
```
6569
extern crate a;
6670
extern crate crate_a as other_name;
@@ -71,6 +75,7 @@ E0260: r##"
7175
The name for an item declaration conflicts with an external crate's name.
7276
7377
For instance,
78+
7479
```
7580
extern crate abc;
7681

0 commit comments

Comments
 (0)