Skip to content

Commit 4fcc795

Browse files
Fuss over the comments on CanonAbi some more
1 parent 313d6a3 commit 4fcc795

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_abi/src/canon_abi.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ impl fmt::Display for CanonAbi {
102102
impl CanonAbi {
103103
/// convert to the ExternAbi that *shares a string* with this CanonAbi
104104
///
105-
/// NOT correct to use if you want to map CanonAbi to an ABI it may have been lowered from,
106-
/// but it is convenient for various "forwarding" implementations. Avoid exposing publicly!
105+
/// A target-insensitive mapping of CanonAbi to ExternAbi, convenient for "forwarding" impls.
106+
/// Importantly, the set of CanonAbi values is a logical *subset* of ExternAbi values,
107+
/// so this is injective: if you take an ExternAbi to a CanonAbi and back, you have lost data.
107108
const fn to_erased_extern_abi(self) -> ExternAbi {
108109
match self {
109110
CanonAbi::C => ExternAbi::C { unwind: false },

0 commit comments

Comments
 (0)