@@ -51,6 +51,7 @@ use quote::TokenStreamExt;
51
51
use crate :: { Entry , HashMap , HashSet } ;
52
52
use std:: borrow:: Cow ;
53
53
use std:: cell:: Cell ;
54
+ use std:: collections:: BTreeMap ;
54
55
use std:: collections:: VecDeque ;
55
56
use std:: fmt:: Write ;
56
57
use std:: iter;
@@ -246,7 +247,7 @@ struct CodegenResult<'a> {
246
247
/// that name. This lets us give each overload a unique suffix.
247
248
overload_counters : HashMap < String , u32 > ,
248
249
249
- variadic_methods : HashMap < Ident , VariadicMethodInfo > ,
250
+ variadic_methods : BTreeMap < Ident , VariadicMethodInfo > ,
250
251
}
251
252
252
253
impl < ' a > CodegenResult < ' a > {
@@ -2513,7 +2514,7 @@ impl MethodCodegen for Method {
2513
2514
let mut ret = utils:: fnsig_return_ty ( ctx, signature) ;
2514
2515
let is_variadic = signature. is_variadic ( ) ;
2515
2516
2516
- if is_variadic & ctx. options ( ) . tuple_varargs_len . is_none ( ) {
2517
+ if is_variadic && ctx. options ( ) . tuple_varargs_len . is_none ( ) {
2517
2518
return ;
2518
2519
}
2519
2520
@@ -5082,9 +5083,8 @@ pub mod utils {
5082
5083
// This will hold the methods to be declared in the `VarArgs` trait as well as the
5083
5084
// bodies of the implementations of such methods for each tuple length.
5084
5085
let ( trait_method_decls, trait_method_impl_fns) : ( Vec < _ > , Vec < _ > ) =
5085
- result
5086
- . variadic_methods
5087
- . drain ( )
5086
+ std:: mem:: take ( & mut result. variadic_methods )
5087
+ . into_iter ( )
5088
5088
. map ( |( name, info) | {
5089
5089
let super :: VariadicMethodInfo { args, ret, exprs } = info;
5090
5090
0 commit comments