@@ -112,23 +112,22 @@ sufficient context to determine the type parameters. For example,
112
112
Extern function _ definitions_ allow defining functions that can be called
113
113
with a particular ABI:
114
114
115
- ``` rust,norun
115
+ ``` rust,no_run
116
116
extern "ABI" fn foo() { ... }
117
117
```
118
118
119
119
An extern function _ declaration_ via an [ external block] can be used to
120
120
provide an item for these functions that can be called by Rust code without
121
121
providing their definition.
122
122
123
- The default ABI of Rust functions like ` fn foo() {} ` is ` "Rust" ` . While we
124
- abbreviate the type of Rust functions like ` foo ` as ` fn() ` , this is actually a
125
- synonym for ` extern "Rust" fn() ` . That is, this:
123
+ When ` "extern" Abi?* ` is omitted from ` FunctionQualifiers ` , the ABI ` "Rust" ` is
124
+ assigned. For example:
126
125
127
126
``` rust
128
127
fn foo () {}
129
128
```
130
129
131
- is identical to
130
+ is equivalent to:
132
131
133
132
``` rust
134
133
extern " Rust" fn foo () {}
@@ -148,30 +147,34 @@ extern "stdcall" fn new_i32_stdcall() -> i32 { 0 }
148
147
```
149
148
150
149
Just as with [ external block] , when the ` extern ` keyword is used and the ` "ABI `
151
- is omitted, the ABI used defaults to ` "C" ` . That is, this
150
+ is omitted, the ABI used defaults to ` "C" ` . That is, this:
152
151
153
152
``` rust
154
153
extern fn new_i32 () -> i32 { 0 }
155
154
let fptr : extern fn () -> i32 = new_i32 ;
156
155
```
157
156
158
- is identical to
157
+ is equivalent to:
159
158
160
159
``` rust
161
160
extern " C" fn new_i32 () -> i32 { 0 }
162
161
let fptr : extern " C" fn () -> i32 = new_i32 ;
163
162
```
164
163
165
- Since functions with an ABI that differs from ` "Rust" ` do not support
166
- unwinding in the exact same way that Rust does, unwinding past the end
167
- of functions with such ABIs causes the process to abort. In LLVM, this is
168
- implemented by executing an illegal instruction.
164
+ Functions with an ABI that differs from ` "Rust" ` do not support unwinding in the
165
+ exact same way that Rust does. Therefore, unwinding past the end of functions
166
+ with such ABIs causes the process to abort.
169
167
170
- Some ABIs that are identical to ` "Rust" ` are:
168
+ ** Non-normative note** : The LLVM backend of the current Rust implementation
169
+ aborts the process by executing an illegal instruction.
171
170
172
- * ` "rust-call" `
173
- * ` "platform-intrinsic" `
174
- * ` "rust-intrinsic" `
171
+ ** Non-normative note** : There are other ABIs available in unstable Rust that are
172
+ equivalent to the ` "Rust" ` ABI, e.g.,
173
+ [ ` "rust-intrinsic" ` ] ( https://doc.rust-lang.org/unstable-book/language-features/intrinsics.html?highlight=rust-intrin#intrinsics )
174
+ or
175
+ [ ` "platform-intrinsic" ` ] ( https://doc.rust-lang.org/unstable-book/language-features/platform-intrinsics.html ) .
176
+ Refer to the [ Unstable Book] ( https://doc.rust-lang.org/unstable-book ) for more
177
+ information about these.
175
178
176
179
## Const functions
177
180
0 commit comments