Skip to content

Commit 1704ebb

Browse files
committed
auto merge of #15421 : catharsis/rust/doc-ffi-minor-fixes, r=alexcrichton
Signed-off-by: Anton Lofgren <[email protected]>
2 parents d336c1a + e737440 commit 1704ebb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/doc/guide-ffi.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ the same stack as the rust stack. This means that there is no extra
173173
stack-switching mechanism in place because it is assumed that the large stack
174174
for the rust task is plenty for the C function to have.
175175

176-
A planned future improvement (net yet implemented at the time of this writing)
176+
A planned future improvement (not yet implemented at the time of this writing)
177177
is to have a guard page at the end of every rust stack. No rust function will
178178
hit this guard page (due to Rust's usage of LLVM's `__morestack`). The intention
179179
for this unmapped page is to prevent infinite recursion in C from overflowing
@@ -201,7 +201,7 @@ It is possible to pass functions defined in Rust to an external library.
201201
The requirement for this is that the callback function is marked as `extern`
202202
with the correct calling convention to make it callable from C code.
203203

204-
The callback function that can then be sent to through a registration call
204+
The callback function can then be sent through a registration call
205205
to the C library and afterwards be invoked from there.
206206

207207
A basic example is:
@@ -243,14 +243,14 @@ void trigger_callback() {
243243
}
244244
~~~~
245245
246-
In this example will Rust's `main()` will call `do_callback()` in C,
247-
which would call back to `callback()` in Rust.
246+
In this example Rust's `main()` will call `do_callback()` in C,
247+
which would, in turn, call back to `callback()` in Rust.
248248
249249
250-
## Targetting callbacks to Rust objects
250+
## Targeting callbacks to Rust objects
251251
252252
The former example showed how a global function can be called from C code.
253-
However it is often desired that the callback is targetted to a special
253+
However it is often desired that the callback is targeted to a special
254254
Rust object. This could be the object that represents the wrapper for the
255255
respective C object.
256256
@@ -334,7 +334,7 @@ it is also absolutely necessary that no more callbacks are performed by the
334334
C library after the respective Rust object gets destroyed.
335335
This can be achieved by unregistering the callback in the object's
336336
destructor and designing the library in a way that guarantees that no
337-
callback will be performed after unregistration.
337+
callback will be performed after deregistration.
338338
339339
# Linking
340340

0 commit comments

Comments
 (0)