@@ -25,7 +25,10 @@ fn current_machine_data_layout() -> String {
25
25
. unwrap ( )
26
26
}
27
27
28
- fn eval_goal ( ra_fixture : & str , minicore : & str ) -> Result < Arc < Layout > , LayoutError > {
28
+ fn eval_goal (
29
+ #[ rust_analyzer:: rust_fixture] ra_fixture : & str ,
30
+ minicore : & str ,
31
+ ) -> Result < Arc < Layout > , LayoutError > {
29
32
let target_data_layout = current_machine_data_layout ( ) ;
30
33
let ra_fixture = format ! (
31
34
"//- target_data_layout: {target_data_layout}\n {minicore}//- /main.rs crate:test\n {ra_fixture}" ,
@@ -81,7 +84,10 @@ fn eval_goal(ra_fixture: &str, minicore: &str) -> Result<Arc<Layout>, LayoutErro
81
84
}
82
85
83
86
/// A version of `eval_goal` for types that can not be expressed in ADTs, like closures and `impl Trait`
84
- fn eval_expr ( ra_fixture : & str , minicore : & str ) -> Result < Arc < Layout > , LayoutError > {
87
+ fn eval_expr (
88
+ #[ rust_analyzer:: rust_fixture] ra_fixture : & str ,
89
+ minicore : & str ,
90
+ ) -> Result < Arc < Layout > , LayoutError > {
85
91
let target_data_layout = current_machine_data_layout ( ) ;
86
92
let ra_fixture = format ! (
87
93
"//- target_data_layout: {target_data_layout}\n {minicore}//- /main.rs crate:test\n fn main(){{let goal = {{{ra_fixture}}};}}" ,
@@ -114,21 +120,31 @@ fn eval_expr(ra_fixture: &str, minicore: &str) -> Result<Arc<Layout>, LayoutErro
114
120
}
115
121
116
122
#[ track_caller]
117
- fn check_size_and_align ( ra_fixture : & str , minicore : & str , size : u64 , align : u64 ) {
123
+ fn check_size_and_align (
124
+ #[ rust_analyzer:: rust_fixture] ra_fixture : & str ,
125
+ minicore : & str ,
126
+ size : u64 ,
127
+ align : u64 ,
128
+ ) {
118
129
let l = eval_goal ( ra_fixture, minicore) . unwrap ( ) ;
119
130
assert_eq ! ( l. size. bytes( ) , size, "size mismatch" ) ;
120
131
assert_eq ! ( l. align. abi. bytes( ) , align, "align mismatch" ) ;
121
132
}
122
133
123
134
#[ track_caller]
124
- fn check_size_and_align_expr ( ra_fixture : & str , minicore : & str , size : u64 , align : u64 ) {
135
+ fn check_size_and_align_expr (
136
+ #[ rust_analyzer:: rust_fixture] ra_fixture : & str ,
137
+ minicore : & str ,
138
+ size : u64 ,
139
+ align : u64 ,
140
+ ) {
125
141
let l = eval_expr ( ra_fixture, minicore) . unwrap ( ) ;
126
142
assert_eq ! ( l. size. bytes( ) , size, "size mismatch" ) ;
127
143
assert_eq ! ( l. align. abi. bytes( ) , align, "align mismatch" ) ;
128
144
}
129
145
130
146
#[ track_caller]
131
- fn check_fail ( ra_fixture : & str , e : LayoutError ) {
147
+ fn check_fail ( # [ rust_analyzer :: rust_fixture ] ra_fixture : & str , e : LayoutError ) {
132
148
let r = eval_goal ( ra_fixture, "" ) ;
133
149
assert_eq ! ( r, Err ( e) ) ;
134
150
}
0 commit comments