Skip to content

Commit c273110

Browse files
committed
Revert "[WIP] Try to fix proc_macro abi incompatibility"
This reverts commit 60fceb7ab7d6474f2ce5f63280772cb48362c87e.
1 parent fb48ee5 commit c273110

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

src/libproc_macro/bridge/buffer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use std::slice;
99
struct Slice<'a, T> {
1010
data: &'a [T; 0],
1111
len: usize,
12-
_a: u8, // Force ByRef passing of this struct
1312
}
1413

1514
unsafe impl<'a, T: Sync> Sync for Slice<'a, T> {}
@@ -24,7 +23,7 @@ impl<T> Clone for Slice<'a, T> {
2423

2524
impl<T> From<&'a [T]> for Slice<'a, T> {
2625
fn from(xs: &'a [T]) -> Self {
27-
Slice { data: unsafe { &*(xs.as_ptr() as *const [T; 0]) }, len: xs.len(), _a: 0 }
26+
Slice { data: unsafe { &*(xs.as_ptr() as *const [T; 0]) }, len: xs.len() }
2827
}
2928
}
3029

src/libproc_macro/bridge/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ macro_rules! define_handles {
4444
}
4545

4646
$(
47-
#[repr(transparent)]
47+
#[repr(C)]
4848
pub(crate) struct $oty(handle::Handle);
4949
impl !Send for $oty {}
5050
impl !Sync for $oty {}
@@ -119,7 +119,7 @@ macro_rules! define_handles {
119119
)*
120120

121121
$(
122-
#[repr(transparent)]
122+
#[repr(C)]
123123
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
124124
pub(crate) struct $ity(handle::Handle);
125125
impl !Send for $ity {}

src/libproc_macro/bridge/closure.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
pub struct Closure<'a, A, R> {
55
call: unsafe extern "C" fn(&mut Env, A) -> R,
66
env: &'a mut Env,
7-
_a: u8, // Force ByRef abi
87
}
98

109
extern "C" {
@@ -19,7 +18,7 @@ impl<'a, A, R, F: FnMut(A) -> R> From<&'a mut F> for Closure<'a, A, R> {
1918
unsafe extern "C" fn call<A, R, F: FnMut(A) -> R>(env: &mut Env, arg: A) -> R {
2019
(*(env as *mut _ as *mut F))(arg)
2120
}
22-
Closure { call: call::<A, R, F>, env: unsafe { &mut *(f as *mut _ as *mut Env) }, _a: 0 }
21+
Closure { call: call::<A, R, F>, env: unsafe { &mut *(f as *mut _ as *mut Env) } }
2322
}
2423
}
2524

src/libproc_macro/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ pub fn is_available() -> bool {
7272
/// and `#[proc_macro_derive]` definitions.
7373
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
7474
#[derive(Clone)]
75-
#[repr(transparent)]
7675
pub struct TokenStream(bridge::client::TokenStream);
7776

7877
#[stable(feature = "proc_macro_lib", since = "1.15.0")]

0 commit comments

Comments
 (0)