File tree 9 files changed +14
-12
lines changed
compiler/rustc_error_codes/src/error_codes
9 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ static X: i32 = 42;
8
8
const Y: i32 = X;
9
9
```
10
10
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
12
12
extracted as a const and then used:
13
13
14
14
```
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
287
287
function. ` Self ` type parameters let us make object safe traits no longer safe,
288
288
so they are forbidden when specifying supertraits.
289
289
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
291
291
you no longer need to derive from ` Super<Self> ` .
Original file line number Diff line number Diff line change 1
- An incorrect number of generic arguments were provided.
1
+ An incorrect number of generic arguments was provided.
2
2
3
3
Erroneous code example:
4
4
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
10
10
where the type was defined. For example, an ` impl ` block as above is not allowed
11
11
since ` Vec ` is defined in the standard library.
12
12
13
- To fix this problem, you can do either of these things :
13
+ To fix this problem, you can either:
14
14
15
15
- define a trait that has the desired associated functions/types/constants and
16
16
implement the trait for the type in question
Original file line number Diff line number Diff line change @@ -59,9 +59,9 @@ fn main() {
59
59
}
60
60
```
61
61
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
63
63
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
65
65
order to make this example compile, we need to restrict the generic type we're
66
66
accepting:
67
67
Original file line number Diff line number Diff line change 25
25
26
26
The type definition contains some field whose type requires an outlives
27
27
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
29
29
commonly arises when the type contains an associated type reference like
30
30
` <T as SomeTrait<'a>>::Output ` , as shown in the previous code.
31
31
Original file line number Diff line number Diff line change 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.
2
2
3
3
Erroneous code example:
4
4
@@ -15,7 +15,7 @@ let mut x = Foo { x: None };
15
15
println!("{:?}", x.x);
16
16
```
17
17
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
19
19
` x ` until the ` println ` . To fix the previous example, just remove the scope
20
20
so that ` y ` isn't dropped until after the println
21
21
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ enum Foo {
11
11
12
12
If you're using a stable or a beta version of rustc, you won't be able to use
13
13
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] ).
15
15
16
16
If you're using a nightly version of rustc, just add the corresponding feature
17
17
to be able to use it:
@@ -24,3 +24,5 @@ enum Foo {
24
24
Bar(u64),
25
25
}
26
26
```
27
+
28
+ [ rustup ] : https://rust-lang.github.io/rustup/concepts/channels.html
Original file line number Diff line number Diff line change 1
- An non-ascii identifier was used in an invalid context.
1
+ A non-ASCII identifier was used in an invalid context.
2
2
3
3
Erroneous code examples:
4
4
@@ -13,7 +13,7 @@ fn řųśť() {} // error!
13
13
fn main() {}
14
14
```
15
15
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] `
17
17
attribute is specified. For example:
18
18
19
19
```
You can’t perform that action at this time.
0 commit comments