@@ -133,12 +133,12 @@ size of ListNode = 1 byte for head
133
133
+ size of ListNode
134
134
```
135
135
136
- One way to fix this is by wrapping `ByteList ` in a `Box`, like so:
136
+ One way to fix this is by wrapping `ListNode ` in a `Box`, like so:
137
137
138
138
```
139
- struct ByteList {
139
+ struct ListNode {
140
140
head: u8,
141
- tail: Option<Box<ByteList >>,
141
+ tail: Option<Box<ListNode >>,
142
142
}
143
143
```
144
144
@@ -147,9 +147,8 @@ This works because `Box` is a pointer, so its size is well-known.
147
147
148
148
E0073 : r##"
149
149
You cannot define a struct (or enum) `Foo` that requires an instance of `Foo`
150
- in order to make a new `Foo` value (think about it: if making an instance of
151
- `Foo` requires an already-existing instance of `Foo`, how does the first
152
- instance get made?).
150
+ in order to make a new `Foo` value. This is because there would be no way a
151
+ first instance of `Foo` could be made to initialize another instance!
153
152
154
153
Here's an example of a struct that has this problem:
155
154
@@ -163,7 +162,7 @@ One fix is to use `Option`, like so:
163
162
struct Foo { x: Option<Box<Foo>> }
164
163
```
165
164
166
- Now it's possible to create at least one instance of Foo: `Foo { x: None }`.
165
+ Now it's possible to create at least one instance of ` Foo` : `Foo { x: None }`.
167
166
"## ,
168
167
169
168
E0081 : r##"
@@ -324,17 +323,8 @@ RFC. It is, however, [currently unimplemented][iss15872].
324
323
"## ,
325
324
326
325
E0121 : r##"
327
- When `_` is in a type, it can act as a placeholder for another type. The
328
- compiler interprets it as a request to infer the type. This enables partial
329
- type hints, as in the following example:
330
-
331
- ```
332
- // x is a Vec<T> for some T. The compiler infers T.
333
- let x: Vec<_> = (0..4).collect();
334
- ```
335
-
336
- However, in order to be consistent with Rust's lack of global type inference,
337
- type placeholders are disallowed by design in item signatures.
326
+ In order to be consistent with Rust's lack of global type inference, type
327
+ placeholders are disallowed by design in item signatures.
338
328
339
329
Examples of this error include:
340
330
@@ -392,8 +382,7 @@ struct Bar<'a> {
392
382
393
383
More details can be found in [RFC 438].
394
384
395
- [RFC 438]: https://github.com/rust-lang/rfcs/blob/master/text/0438-precedence-\
396
- of-plus.md
385
+ [RFC 438]: https://github.com/rust-lang/rfcs/pull/438
397
386
"## ,
398
387
399
388
E0184 : r##"
0 commit comments