Skip to content

Commit fabb332

Browse files
committed
Edit multiple error code Markdown files
Makes small edits to several error code files. Fixes some missing punctuation. Changes some wording, grammar, and formatting for clarity and readability. Adds a link to the rustup book in E0658.
1 parent b122908 commit fabb332

File tree

9 files changed

+14
-12
lines changed

9 files changed

+14
-12
lines changed

compiler/rustc_error_codes/src/error_codes/E0013.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ static X: i32 = 42;
88
const Y: i32 = X;
99
```
1010

11-
In this example, `Y` cannot refer to `X` here. To fix this, the value can be
11+
In this example, `Y` cannot refer to `X`. To fix this, the value can be
1212
extracted as a const and then used:
1313

1414
```

compiler/rustc_error_codes/src/error_codes/E0038.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,5 +287,5 @@ the method `get_a()` would return an object of unknown type when called on the
287287
function. `Self` type parameters let us make object safe traits no longer safe,
288288
so they are forbidden when specifying supertraits.
289289

290-
There's no easy fix for this, generally code will need to be refactored so that
290+
There's no easy fix for this. Generally, code will need to be refactored so that
291291
you no longer need to derive from `Super<Self>`.

compiler/rustc_error_codes/src/error_codes/E0107.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
An incorrect number of generic arguments were provided.
1+
An incorrect number of generic arguments was provided.
22

33
Erroneous code example:
44

compiler/rustc_error_codes/src/error_codes/E0116.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can only define an inherent implementation for a type in the same crate
1010
where the type was defined. For example, an `impl` block as above is not allowed
1111
since `Vec` is defined in the standard library.
1212

13-
To fix this problem, you can do either of these things:
13+
To fix this problem, you can either:
1414

1515
- define a trait that has the desired associated functions/types/constants and
1616
implement the trait for the type in question

compiler/rustc_error_codes/src/error_codes/E0277.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ fn main() {
5959
}
6060
```
6161

62-
Note that the error here is in the definition of the generic function: Although
62+
Note that the error here is in the definition of the generic function. Although
6363
we only call it with a parameter that does implement `Debug`, the compiler
64-
still rejects the function: It must work with all possible input types. In
64+
still rejects the function. It must work with all possible input types. In
6565
order to make this example compile, we need to restrict the generic type we're
6666
accepting:
6767

compiler/rustc_error_codes/src/error_codes/E0309.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ where
2525

2626
The type definition contains some field whose type requires an outlives
2727
annotation. Outlives annotations (e.g., `T: 'a`) are used to guarantee that all
28-
the data in T is valid for at least the lifetime `'a`. This scenario most
28+
the data in `T` is valid for at least the lifetime `'a`. This scenario most
2929
commonly arises when the type contains an associated type reference like
3030
`<T as SomeTrait<'a>>::Output`, as shown in the previous code.
3131

compiler/rustc_error_codes/src/error_codes/E0597.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This error occurs because a value was dropped while it was still borrowed
1+
This error occurs because a value was dropped while it was still borrowed.
22

33
Erroneous code example:
44

@@ -15,7 +15,7 @@ let mut x = Foo { x: None };
1515
println!("{:?}", x.x);
1616
```
1717

18-
In here, `y` is dropped at the end of the inner scope, but it is borrowed by
18+
Here, `y` is dropped at the end of the inner scope, but it is borrowed by
1919
`x` until the `println`. To fix the previous example, just remove the scope
2020
so that `y` isn't dropped until after the println
2121

compiler/rustc_error_codes/src/error_codes/E0658.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enum Foo {
1111

1212
If you're using a stable or a beta version of rustc, you won't be able to use
1313
any unstable features. In order to do so, please switch to a nightly version of
14-
rustc (by using rustup).
14+
rustc (by using [rustup]).
1515

1616
If you're using a nightly version of rustc, just add the corresponding feature
1717
to be able to use it:
@@ -24,3 +24,5 @@ enum Foo {
2424
Bar(u64),
2525
}
2626
```
27+
28+
[rustup]: https://rust-lang.github.io/rustup/concepts/channels.html

compiler/rustc_error_codes/src/error_codes/E0754.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
An non-ascii identifier was used in an invalid context.
1+
A non-ASCII identifier was used in an invalid context.
22

33
Erroneous code examples:
44

@@ -13,7 +13,7 @@ fn řųśť() {} // error!
1313
fn main() {}
1414
```
1515

16-
Non-ascii can be used as module names if it is inlined or if a `#[path]`
16+
Non-ASCII can be used as module names if it is inlined or if a `#[path]`
1717
attribute is specified. For example:
1818

1919
```

0 commit comments

Comments
 (0)