@@ -106,95 +106,19 @@ impl Bag {
106106}
107107
108108impl Default for Bag {
109- #[ rustfmt:: skip]
110109 fn default ( ) -> Self {
111- // TODO: [no_op; MAX_OBJECTS] syntax blocked by https://github.com/rust-lang/rust/issues/49147
112- #[ cfg( not( crossbeam_sanitize) ) ]
113- return Bag {
110+ Bag {
114111 len : 0 ,
115- deferreds : [
116- Deferred :: new ( no_op_func) ,
117- Deferred :: new ( no_op_func) ,
118- Deferred :: new ( no_op_func) ,
119- Deferred :: new ( no_op_func) ,
120- Deferred :: new ( no_op_func) ,
121- Deferred :: new ( no_op_func) ,
122- Deferred :: new ( no_op_func) ,
123- Deferred :: new ( no_op_func) ,
124- Deferred :: new ( no_op_func) ,
125- Deferred :: new ( no_op_func) ,
126- Deferred :: new ( no_op_func) ,
127- Deferred :: new ( no_op_func) ,
128- Deferred :: new ( no_op_func) ,
129- Deferred :: new ( no_op_func) ,
130- Deferred :: new ( no_op_func) ,
131- Deferred :: new ( no_op_func) ,
132- Deferred :: new ( no_op_func) ,
133- Deferred :: new ( no_op_func) ,
134- Deferred :: new ( no_op_func) ,
135- Deferred :: new ( no_op_func) ,
136- Deferred :: new ( no_op_func) ,
137- Deferred :: new ( no_op_func) ,
138- Deferred :: new ( no_op_func) ,
139- Deferred :: new ( no_op_func) ,
140- Deferred :: new ( no_op_func) ,
141- Deferred :: new ( no_op_func) ,
142- Deferred :: new ( no_op_func) ,
143- Deferred :: new ( no_op_func) ,
144- Deferred :: new ( no_op_func) ,
145- Deferred :: new ( no_op_func) ,
146- Deferred :: new ( no_op_func) ,
147- Deferred :: new ( no_op_func) ,
148- Deferred :: new ( no_op_func) ,
149- Deferred :: new ( no_op_func) ,
150- Deferred :: new ( no_op_func) ,
151- Deferred :: new ( no_op_func) ,
152- Deferred :: new ( no_op_func) ,
153- Deferred :: new ( no_op_func) ,
154- Deferred :: new ( no_op_func) ,
155- Deferred :: new ( no_op_func) ,
156- Deferred :: new ( no_op_func) ,
157- Deferred :: new ( no_op_func) ,
158- Deferred :: new ( no_op_func) ,
159- Deferred :: new ( no_op_func) ,
160- Deferred :: new ( no_op_func) ,
161- Deferred :: new ( no_op_func) ,
162- Deferred :: new ( no_op_func) ,
163- Deferred :: new ( no_op_func) ,
164- Deferred :: new ( no_op_func) ,
165- Deferred :: new ( no_op_func) ,
166- Deferred :: new ( no_op_func) ,
167- Deferred :: new ( no_op_func) ,
168- Deferred :: new ( no_op_func) ,
169- Deferred :: new ( no_op_func) ,
170- Deferred :: new ( no_op_func) ,
171- Deferred :: new ( no_op_func) ,
172- Deferred :: new ( no_op_func) ,
173- Deferred :: new ( no_op_func) ,
174- Deferred :: new ( no_op_func) ,
175- Deferred :: new ( no_op_func) ,
176- Deferred :: new ( no_op_func) ,
177- Deferred :: new ( no_op_func) ,
178- ] ,
179- } ;
180- #[ cfg( crossbeam_sanitize) ]
181- return Bag {
182- len : 0 ,
183- deferreds : [
184- Deferred :: new ( no_op_func) ,
185- Deferred :: new ( no_op_func) ,
186- Deferred :: new ( no_op_func) ,
187- Deferred :: new ( no_op_func) ,
188- ] ,
189- } ;
112+ deferreds : [ Deferred :: NO_OP ; MAX_OBJECTS ] ,
113+ }
190114 }
191115}
192116
193117impl Drop for Bag {
194118 fn drop ( & mut self ) {
195119 // Call all deferred functions.
196120 for deferred in & mut self . deferreds [ ..self . len ] {
197- let no_op = Deferred :: new ( no_op_func ) ;
121+ let no_op = Deferred :: NO_OP ;
198122 let owned_deferred = mem:: replace ( deferred, no_op) ;
199123 owned_deferred. call ( ) ;
200124 }
@@ -210,8 +134,6 @@ impl fmt::Debug for Bag {
210134 }
211135}
212136
213- fn no_op_func ( ) { }
214-
215137/// A pair of an epoch and a bag.
216138#[ derive( Default , Debug ) ]
217139struct SealedBag {
0 commit comments