You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/abi.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,16 +26,6 @@ Function calls pass parameters and return values between the caller and the call
26
26
> If an invalid value is passed as a parameter or returned from a function, the result is immediate undefined behaviour, even if the parameter or return value is never used.
27
27
> For example, passing a null pointer to a function that accepts a `NonNull<i32>` parameter via `fn(*const i32)` function pointer caused undefined behaviour.
28
28
29
-
r[abi.compatibility.equivalence]
30
-
Two types `T` and `U` are *abi compatible* if:
31
-
* They are the same type,
32
-
*`U` is *abi compatible* with `T`, or
33
-
* There exists a type `V`, such that `T` is *abi compatible* with `V` an `V` is *abi compatible* with `U`,
34
-
35
-
> [!NOTE]
36
-
> These properties are respectively called "reflexivity", "symmetry", and "transitivity". They ensure that *abi compatibility* is an equivalence relation.
37
-
> ABI compatibility is a pairwise relation between two types. With Transivity and Symmetry, however, it can be well-defined to refer to several types being ABI compatible
38
-
39
29
r[abi.compatibility.integer]
40
30
Two [integer types] are *abi compatible* if they have the same width and the same signedness.
If `T` is an a type listed in [layout.repr.rust.option.elision], and `U` is the type of the *elision candidate field*, then `T` is layout compatible with `U`.
137
127
138
128
> [!NOTE]
139
-
> `Option<U>`, `Result<U,Z>`, or `Result<Z,U>` are such types, when `U` are *elision candidate type*s, and `Z` is a 1-ZST type.
129
+
> `Option<U>`, `Result<U,Z>`, or `Result<Z,U>` are examples of such types, when `U` are *elision candidate type*s, and `Z` is a 1-ZST type.
140
130
>
141
131
> Due to transitivity, two such types are *abi compatible* with each other if their *elision candidate field*s are *abi comaptible*
142
132
143
133
r[abi.compatibility.fn-ptr]
144
134
A [function pointer] type `T` is *abi compatible* with an [function pointer] type `U` if `T` and `U` have *abi compatible* tags.
145
135
136
+
r[abi.compatibility.equivalence]
137
+
Two types `T` and `U` are *abi compatible* if:
138
+
* They are the same type,
139
+
*`U` is *abi compatible* with `T`, or
140
+
* There exists a type `V`, such that `T` is *abi compatible* with `V` an `V` is *abi compatible* with `U`,
141
+
142
+
> [!NOTE]
143
+
> These properties are respectively called "reflexivity", "symmetry", and "transitivity". They ensure that *abi compatibility* is an equivalence relation.
144
+
> ABI compatibility is a pairwise relation between two types. With Transivity and Symmetry, however, it can be well-defined to refer to several types being ABI compatible
0 commit comments