7
7
[ summary ] : #summary
8
8
9
9
This RFC adds a new function attribute, ` #[ffi_returns_twice] ` , which indicates
10
- that an ` extern ` function can return multiple times.
10
+ that an foreign function can return multiple times.
11
11
12
12
# Motivation
13
13
[ motivation ] : #motivation
@@ -22,10 +22,10 @@ return only once. That is, when the execution arrives at the function call, the
22
22
function is called, it returns a single value, and that's it. This assumption
23
23
allows Rust to perform many optimizations.
24
24
25
- However, some ` extern ` functions like [ ` setjmp ` ] and [ ` vfork ` ] can return
25
+ However, some foreign functions like [ ` setjmp ` ] and [ ` vfork ` ] can return
26
26
multiple times.
27
27
28
- The ` #[ffi_returns_twice] ` attribute specifies that an ` extern ` function might
28
+ The ` #[ffi_returns_twice] ` attribute specifies that an foreign function might
29
29
returns multiple times, inhibiting optimizations that assume that this is never
30
30
the case.
31
31
@@ -36,7 +36,7 @@ the case.
36
36
# Guide-level and reference-level explanation
37
37
[ guide-level-explanation ] : #guide-level-explanation
38
38
39
- The ` #[ffi_returns_twice] ` function attribute specifies that an ` extern ` function
39
+ The ` #[ffi_returns_twice] ` function attribute specifies that an foreign function
40
40
might return multiple times, disabling optimizations that are incorrect for such
41
41
functions. Two examples of such functions are [ ` setjmp ` ] and [ ` vfork ` ] .
42
42
@@ -89,7 +89,7 @@ multiple times possible?
89
89
# Future possibilities
90
90
[ future-possibilities ] : #future-possibilities
91
91
92
- This RFC attempts to make writing programs that interface with extern functions
92
+ This RFC attempts to make writing programs that interface with foreign functions
93
93
that return multiple times possible, but doing so is very challenging because it
94
94
is trivial to introduce undefined behavior in those programs.
95
95
0 commit comments