Skip to content

Commit c1dcf1d

Browse files
committed
Fix RFC 1327 hyperlink in dropck
- Fix hyperlink to RFC 1327 in the section on the dropck. - Fix other nits
1 parent aed22ff commit c1dcf1d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/dropck.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ error: `days` does not live long enough
9494
error: aborting due to previous error
9595
```
9696

97-
Implementing Drop lets the Inspector execute some arbitrary code during its
97+
Implementing `Drop` lets the `Inspector` execute some arbitrary code during its
9898
death. This means it can potentially observe that types that are supposed to
9999
live as long as it does actually were destroyed first.
100100

@@ -168,7 +168,7 @@ checker during the analysis of `fn main`, saying that `days` does not
168168
live long enough.
169169

170170
The reason is that the borrow checking analysis of `main` does not
171-
know about the internals of each Inspector's Drop implementation. As
171+
know about the internals of each `Inspector`'s `Drop` implementation. As
172172
far as the borrow checker knows while it is analyzing `main`, the body
173173
of an inspector's destructor might access that borrowed data.
174174

@@ -185,17 +185,16 @@ borrowed data in a value to outlive that value, which is certainly sound.
185185

186186
Future versions of the language may make the analysis more precise, to
187187
reduce the number of cases where sound code is rejected as unsafe.
188-
This would help address cases such as the two Inspectors above that
188+
This would help address cases such as the two `Inspector`s above that
189189
know not to inspect during destruction.
190190

191191
In the meantime, there is an unstable attribute that one can use to
192192
assert (unsafely) that a generic type's destructor is *guaranteed* to
193193
not access any expired data, even if its type gives it the capability
194194
to do so.
195195

196-
That attribute is called `may_dangle` and was introduced in [RFC 1327]
197-
(https://github.com/rust-lang/rfcs/blob/master/text/1327-dropck-param-eyepatch.md).
198-
To deploy it on the Inspector example from above, we would write:
196+
That attribute is called `may_dangle` and was introduced in [RFC 1327][rfc1327].
197+
To deploy it on the `Inspector` example from above, we would write:
199198

200199
```rust,ignore
201200
struct Inspector<'a>(&'a u8, &'static str);
@@ -287,3 +286,4 @@ worry at all about doing the right thing for the drop checker. However there
287286
is one special case that you need to worry about, which we will look at in
288287
the next section.
289288

289+
[rfc1327]: https://github.com/rust-lang/rfcs/blob/master/text/1327-dropck-param-eyepatch.md

0 commit comments

Comments
 (0)