File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,9 @@ impl fmt::Display for CanonAbi {
102102impl 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 } ,
@@ -136,8 +137,8 @@ impl CanonAbi {
136137
137138 /// convert an ExternAbi to a CanonAbi if it maps directly
138139 ///
139- /// Like `to_erased_extern_abi`, this is only intended for internal usage by
140- /// CanonAbi's implementation, as it is not "target-aware" .
140+ /// A target-insensitive mapping of ExternAbi to CanonAbi. This is a partial function,
141+ /// and mostly serves as a way to reuse ExternAbi's code .
141142 const fn try_from_extern_abi ( extern_abi : ExternAbi ) -> Result < Self , AbiConvErr > {
142143 match extern_abi {
143144 ExternAbi :: C { unwind : false } => Ok ( Self :: C ) ,
You can’t perform that action at this time.
0 commit comments