77[ summary ] : #summary
88
99This 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.
1111
1212# Motivation
1313[ motivation ] : #motivation
@@ -22,10 +22,10 @@ return only once. That is, when the execution arrives at the function call, the
2222function is called, it returns a single value, and that's it. This assumption
2323allows Rust to perform many optimizations.
2424
25- However, some ` extern ` functions like [ ` setjmp ` ] and [ ` vfork ` ] can return
25+ However, some foreign functions like [ ` setjmp ` ] and [ ` vfork ` ] can return
2626multiple times.
2727
28- The ` #[ffi_returns_twice] ` attribute specifies that an ` extern ` function might
28+ The ` #[ffi_returns_twice] ` attribute specifies that an foreign function might
2929returns multiple times, inhibiting optimizations that assume that this is never
3030the case.
3131
@@ -36,7 +36,7 @@ the case.
3636# Guide-level and reference-level explanation
3737[ guide-level-explanation ] : #guide-level-explanation
3838
39- The ` #[ffi_returns_twice] ` function attribute specifies that an ` extern ` function
39+ The ` #[ffi_returns_twice] ` function attribute specifies that an foreign function
4040might return multiple times, disabling optimizations that are incorrect for such
4141functions. Two examples of such functions are [ ` setjmp ` ] and [ ` vfork ` ] .
4242
@@ -89,7 +89,7 @@ multiple times possible?
8989# Future possibilities
9090[ future-possibilities ] : #future-possibilities
9191
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
9393that return multiple times possible, but doing so is very challenging because it
9494is trivial to introduce undefined behavior in those programs.
9595
0 commit comments