Skip to content

Commit 5bb70c1

Browse files
Fix tidy issues
1 parent 243fb6f commit 5bb70c1

File tree

12 files changed

+15
-20
lines changed

12 files changed

+15
-20
lines changed

src/librustc_error_codes/error_codes/E0015.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
A constant item was initialized with something that is not a constant expression.
1+
A constant item was initialized with something that is not a constant
2+
expression.
23

34
Erroneous code example:
45

src/librustc_error_codes/error_codes/E0107.md

-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ fn main() {
2525
// expected 0, found 1
2626
}
2727
```
28-

src/librustc_error_codes/error_codes/E0369.md

-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ left and may require reallocation. This requires ownership of the string
2626
on the left. If something should be added to a string literal, move the
2727
literal to the heap by allocating it with `to_owned()` like in
2828
`"Your text".to_owned()`.
29-

src/librustc_error_codes/error_codes/E0404.md

-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ trait Foo {
4141
4242
fn bar<T: Foo>(t: T) {} // ok!
4343
```
44-

src/librustc_error_codes/error_codes/E0458.md

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ Please specify a valid "kind" value, from one of the following:
1010
* static
1111
* dylib
1212
* framework
13-

src/librustc_error_codes/error_codes/E0633.md

-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ The `#[unwind]` attribute should be used as follows:
2121

2222
NB. The default behavior here is "allowed", but this is unspecified
2323
and likely to change in the future.
24-

src/librustc_error_codes/error_codes/E0635.md

-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ Erroneous code example:
55
```compile_fail,E0635
66
#![feature(nonexistent_rust_feature)] // error: unknown feature
77
```
8-

src/librustc_error_codes/error_codes/E0636.md

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ Erroneous code example:
77
#![feature(rust1)]
88
#![feature(rust1)] // error: the feature `rust1` has already been declared
99
```
10-

src/librustc_error_codes/error_codes/E0641.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ let a = &(String::from("Hello world!")) as *const _; // Ok
1616
let b = 0 as *const i32; // Ok
1717
1818
let c: *const i32 = 0 as *const _; // Ok
19-
```
19+
```

src/librustc_error_codes/error_codes/E0644.md

-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ closure call itself by capturing a `&Fn()` object or `fn()` pointer
2727
that refers to itself. That is permitting, since the closure would be
2828
invoking itself via a virtual call, and hence does not directly
2929
reference its own *type*.
30-

src/librustc_error_codes/error_codes/E0706.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
`async fn`s are not yet supported in traits in Rust.
1+
`async fn`s are not yet supported in traits in Rust.
22

33
Erroneous code example:
44

@@ -10,7 +10,8 @@ trait T {
1010
}
1111
```
1212

13-
`async fn`s return an `impl Future`, making the following two examples equivalent:
13+
`async fn`s return an `impl Future`, making the following two examples
14+
equivalent:
1415

1516
```edition2018,ignore (example-of-desugaring-equivalence)
1617
async fn foo() -> User {
@@ -23,8 +24,8 @@ fn foo(&self) -> impl Future<Output = User> + '_ {
2324
```
2425

2526
But when it comes to supporting this in traits, there are [a few implementation
26-
issues][async-is-hard]. One of them is returning `impl Trait` in traits is not supported,
27-
as it would require [Generic Associated Types] to be supported:
27+
issues][async-is-hard]. One of them is returning `impl Trait` in traits is not
28+
supported, as it would require [Generic Associated Types] to be supported:
2829

2930
```edition2018,ignore (example-of-desugaring-equivalence)
3031
impl MyDatabase {
@@ -40,13 +41,14 @@ impl MyDatabase {
4041
}
4142
```
4243

43-
Until these issues are resolved, you can use the [`async-trait` crate], allowing you to use
44-
`async fn` in traits by desugaring to "boxed futures"
44+
Until these issues are resolved, you can use the [`async-trait` crate], allowing
45+
you to use `async fn` in traits by desugaring to "boxed futures"
4546
(`Pin<Box<dyn Future + Send + 'async>>`).
4647

47-
Note that using these trait methods will result in a heap allocation per-function-call. This is not
48-
a significant cost for the vast majority of applications, but should be considered when deciding
49-
whether to use this functionality in the public API of a low-level function that is expected to be
48+
Note that using these trait methods will result in a heap allocation
49+
per-function-call. This is not a significant cost for the vast majority of
50+
applications, but should be considered when deciding whether to use this
51+
functionality in the public API of a low-level function that is expected to be
5052
called millions of times a second.
5153

5254
You might be interested in visiting the [async book] for further information.

src/librustc_error_codes/error_codes/E0745.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn temp_address() {
1111

1212
To avoid the error, first bind the temporary to a named local variable.
1313

14-
```ignore
14+
```ignore (not yet implemented)
1515
# #![feature(raw_ref_op)]
1616
fn temp_address() {
1717
let val = 2;

0 commit comments

Comments
 (0)