Skip to content

Commit 87e68ef

Browse files
committed
format
1 parent fca4e16 commit 87e68ef

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

‎docs/src/runtime/fn-ptr.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ A cast to a different type allocates: the pointer then also keeps the function
8686
it was created with, type-erased, so that casting back to that type can restore
8787
it. A call through the adapter moves each pointer or record argument through a
8888
heap cell, so a value without a copy constructor can be passed too; direct calls
89-
never allocate. Equality compares the address of the function
90-
the pointer was created with.
89+
never allocate. Equality compares the address of the function the pointer was
90+
created with.
9191

9292
Casting a function pointer to `void *` is `to_any`, and `AnyPtr::cast_fn::<T>`
9393
recovers it. `reinterpret_cast` on an `AnyPtr` holding a function currently

‎libcc2rs/src/fn_ptr_arg.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ impl_fn_ptr_arg_prim!(f64);
8282
impl FnPtrArg for bool {
8383
#[inline]
8484
fn to_repr(self) -> ArgRepr {
85-
ArgRepr::Bytes(
86-
[self as u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
87-
1,
88-
)
85+
ArgRepr::Bytes([self as u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 1)
8986
}
9087
#[inline]
9188
fn from_repr(r: ArgRepr) -> Self {

‎tests/unit/out/refcount/overload_mangling.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct S {
3131
}
3232
#[derive(Clone, Record, ByteRepr, VaArg, FnPtrArg, Default)]
3333
#[byte_size(4)]
34-
pub struct Box {
34+
pub struct Box_ {
3535
#[offset(0)]
3636
pub v: i32,
3737
}
@@ -134,7 +134,7 @@ fn main_0() -> i32 {
134134
Access_S_Impl::ref_4(&a.as_pointer(), _r)
135135
}) == 103)
136136
);
137-
let mut b: Box = Box { v: 4 };
137+
let mut b: Box_ = Box_ { v: 4 };
138138
assert!((b.v == 4));
139139
return 0;
140140
}

‎tests/unit/out/unsafe/overload_mangling.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl S {
111111
}
112112
#[repr(C)]
113113
#[derive(Copy, Clone, VaArg, FnPtrArg, Default)]
114-
pub struct Box {
114+
pub struct Box_ {
115115
pub v: i32,
116116
}
117117
pub fn main() {
@@ -170,7 +170,7 @@ unsafe fn main_0() -> i32 {
170170
Access_S_::ref_4(&mut a, _r)
171171
}) == (103))
172172
);
173-
let mut b: Box = Box { v: 4 };
173+
let mut b: Box_ = Box_ { v: 4 };
174174
assert!(((b.v) == (4)));
175175
return 0;
176176
}

0 commit comments

Comments
 (0)