@@ -8,6 +8,7 @@ use std::rc::Rc;
8
8
use std:: sync:: Arc ;
9
9
use std:: { slice, vec} ;
10
10
11
+ use arrayvec:: ArrayVec ;
11
12
use rustc_ast:: attr;
12
13
use rustc_ast:: util:: comments:: beautify_doc_string;
13
14
use rustc_ast:: { self as ast, AttrStyle } ;
@@ -28,7 +29,6 @@ use rustc_span::symbol::{kw, sym, Ident, Symbol, SymbolStr};
28
29
use rustc_span:: { self , FileName , Loc } ;
29
30
use rustc_target:: abi:: VariantIdx ;
30
31
use rustc_target:: spec:: abi:: Abi ;
31
- use smallvec:: { smallvec, SmallVec } ;
32
32
33
33
use crate :: clean:: cfg:: Cfg ;
34
34
use crate :: clean:: external_path;
@@ -1539,12 +1539,12 @@ impl PrimitiveType {
1539
1539
}
1540
1540
}
1541
1541
1542
- crate fn impls ( & self , tcx : TyCtxt < ' _ > ) -> & ' static SmallVec < [ DefId ; 4 ] > {
1542
+ crate fn impls ( & self , tcx : TyCtxt < ' _ > ) -> & ' static ArrayVec < [ DefId ; 4 ] > {
1543
1543
Self :: all_impls ( tcx) . get ( self ) . expect ( "missing impl for primitive type" )
1544
1544
}
1545
1545
1546
- crate fn all_impls ( tcx : TyCtxt < ' _ > ) -> & ' static FxHashMap < PrimitiveType , SmallVec < [ DefId ; 4 ] > > {
1547
- static CELL : OnceCell < FxHashMap < PrimitiveType , SmallVec < [ DefId ; 4 ] > > > = OnceCell :: new ( ) ;
1546
+ crate fn all_impls ( tcx : TyCtxt < ' _ > ) -> & ' static FxHashMap < PrimitiveType , ArrayVec < [ DefId ; 4 ] > > {
1547
+ static CELL : OnceCell < FxHashMap < PrimitiveType , ArrayVec < [ DefId ; 4 ] > > > = OnceCell :: new ( ) ;
1548
1548
1549
1549
CELL . get_or_init ( move || {
1550
1550
use self :: PrimitiveType :: * ;
@@ -1568,7 +1568,7 @@ impl PrimitiveType {
1568
1568
}
1569
1569
1570
1570
let single = |a : Option < DefId > | a. into_iter ( ) . collect ( ) ;
1571
- let both = |a : Option < DefId > , b : Option < DefId > | -> SmallVec < _ > {
1571
+ let both = |a : Option < DefId > , b : Option < DefId > | -> ArrayVec < _ > {
1572
1572
a. into_iter ( ) . chain ( b) . collect ( )
1573
1573
} ;
1574
1574
@@ -1601,8 +1601,8 @@ impl PrimitiveType {
1601
1601
. collect( )
1602
1602
} ,
1603
1603
Array => single( lang_items. array_impl( ) ) ,
1604
- Tuple => smallvec! [ ] ,
1605
- Unit => smallvec! [ ] ,
1604
+ Tuple => ArrayVec :: new ( ) ,
1605
+ Unit => ArrayVec :: new ( ) ,
1606
1606
RawPointer => {
1607
1607
lang_items
1608
1608
. const_ptr_impl( )
@@ -1612,9 +1612,9 @@ impl PrimitiveType {
1612
1612
. chain( lang_items. mut_slice_ptr_impl( ) )
1613
1613
. collect( )
1614
1614
} ,
1615
- Reference => smallvec! [ ] ,
1616
- Fn => smallvec! [ ] ,
1617
- Never => smallvec! [ ] ,
1615
+ Reference => ArrayVec :: new ( ) ,
1616
+ Fn => ArrayVec :: new ( ) ,
1617
+ Never => ArrayVec :: new ( ) ,
1618
1618
}
1619
1619
} )
1620
1620
}
0 commit comments