22
22
//! need to update the conditionals in `Abi::from_lib` to return your new ABI
23
23
//! for the relevant versions of the rust compiler
24
24
25
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
25
26
mod abi_1_58;
27
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
26
28
mod abi_1_63;
29
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
27
30
mod abi_1_64;
28
31
#[ cfg( feature = "in-rust-tree" ) ]
29
32
mod abi_sysroot;
@@ -33,8 +36,11 @@ mod abi_sysroot;
33
36
pub ( crate ) use abi_1_64:: TokenStream as TestTokenStream ;
34
37
35
38
use super :: dylib:: LoadProcMacroDylibError ;
39
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
36
40
pub ( crate ) use abi_1_58:: Abi as Abi_1_58 ;
41
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
37
42
pub ( crate ) use abi_1_63:: Abi as Abi_1_63 ;
43
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
38
44
pub ( crate ) use abi_1_64:: Abi as Abi_1_64 ;
39
45
#[ cfg( feature = "in-rust-tree" ) ]
40
46
pub ( crate ) use abi_sysroot:: Abi as AbiSysroot ;
@@ -52,8 +58,11 @@ impl PanicMessage {
52
58
}
53
59
54
60
pub ( crate ) enum Abi {
61
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
55
62
Abi1_58 ( Abi_1_58 ) ,
63
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
56
64
Abi1_63 ( Abi_1_63 ) ,
65
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
57
66
Abi1_64 ( Abi_1_64 ) ,
58
67
#[ cfg( feature = "in-rust-tree" ) ]
59
68
Sysroot ( AbiSysroot ) ,
@@ -82,6 +91,7 @@ impl Abi {
82
91
83
92
// FIXME: this should use exclusive ranges when they're stable
84
93
// https://github.com/rust-lang/rust/issues/37854
94
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
85
95
match ( info. version . 0 , info. version . 1 ) {
86
96
( 1 , 58 ..=62 ) => {
87
97
let inner = unsafe { Abi_1_58 :: from_lib ( lib, symbol_name) } ?;
@@ -106,8 +116,11 @@ impl Abi {
106
116
attributes : Option < & tt:: Subtree > ,
107
117
) -> Result < tt:: Subtree , PanicMessage > {
108
118
match self {
119
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
109
120
Self :: Abi1_58 ( abi) => abi. expand ( macro_name, macro_body, attributes) ,
121
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
110
122
Self :: Abi1_63 ( abi) => abi. expand ( macro_name, macro_body, attributes) ,
123
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
111
124
Self :: Abi1_64 ( abi) => abi. expand ( macro_name, macro_body, attributes) ,
112
125
#[ cfg( feature = "in-rust-tree" ) ]
113
126
Self :: AbiSysroot ( abi) => abi. expand ( macro_name, macro_body, attributes) ,
@@ -116,8 +129,11 @@ impl Abi {
116
129
117
130
pub fn list_macros ( & self ) -> Vec < ( String , ProcMacroKind ) > {
118
131
match self {
132
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
119
133
Self :: Abi1_58 ( abi) => abi. list_macros ( ) ,
134
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
120
135
Self :: Abi1_63 ( abi) => abi. list_macros ( ) ,
136
+ #[ cfg( not( feature = "in-rust-tree" ) ) ]
121
137
Self :: Abi1_64 ( abi) => abi. list_macros ( ) ,
122
138
#[ cfg( feature = "in-rust-tree" ) ]
123
139
Self :: AbiSysroot ( abi) => abi. list_macros ( ) ,
0 commit comments