Skip to content

Edit multiple error code Markdown files #81572

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
Feb 1, 2021
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
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0013.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ static X: i32 = 42;
const Y: i32 = X;
```

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

```
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0038.md
Original file line number Diff line number Diff line change
@@ -287,5 +287,5 @@ the method `get_a()` would return an object of unknown type when called on the
function. `Self` type parameters let us make object safe traits no longer safe,
so they are forbidden when specifying supertraits.

There's no easy fix for this, generally code will need to be refactored so that
There's no easy fix for this. Generally, code will need to be refactored so that
you no longer need to derive from `Super<Self>`.
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0107.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
An incorrect number of generic arguments were provided.
An incorrect number of generic arguments was provided.

Erroneous code example:

2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0116.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ You can only define an inherent implementation for a type in the same crate
where the type was defined. For example, an `impl` block as above is not allowed
since `Vec` is defined in the standard library.

To fix this problem, you can do either of these things:
To fix this problem, you can either:

- define a trait that has the desired associated functions/types/constants and
implement the trait for the type in question
4 changes: 2 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0277.md
Original file line number Diff line number Diff line change
@@ -59,9 +59,9 @@ fn main() {
}
```

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

2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0309.md
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ where

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

4 changes: 2 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0597.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This error occurs because a value was dropped while it was still borrowed
This error occurs because a value was dropped while it was still borrowed.

Erroneous code example:

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

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

4 changes: 3 additions & 1 deletion compiler/rustc_error_codes/src/error_codes/E0658.md
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ enum Foo {

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

If you're using a nightly version of rustc, just add the corresponding feature
to be able to use it:
@@ -24,3 +24,5 @@ enum Foo {
Bar(u64),
}
```

[rustup]: https://rust-lang.github.io/rustup/concepts/channels.html
4 changes: 2 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0754.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
An non-ascii identifier was used in an invalid context.
A non-ASCII identifier was used in an invalid context.

Erroneous code examples:

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

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

```