File tree 3 files changed +8
-1
lines changed
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
fn main ( ) {
2
2
println ! ( "cargo:rerun-if-changed=build.rs" ) ;
3
- println ! ( "cargo:rustc-check-cfg=cfg(slab_no_const_vec_new,slab_no_track_caller)" ) ;
3
+ println ! (
4
+ "cargo:rustc-check-cfg=cfg(slab_no_const_vec_new,slab_no_track_caller,slab_no_const_generics)"
5
+ ) ;
4
6
5
7
let cfg = match autocfg:: AutoCfg :: new ( ) {
6
8
Ok ( cfg) => cfg,
@@ -24,4 +26,7 @@ fn main() {
24
26
if !cfg. probe_rustc_version ( 1 , 46 ) {
25
27
println ! ( "cargo:rustc-cfg=slab_no_track_caller" ) ;
26
28
}
29
+ if !cfg. probe_rustc_version ( 1 , 51 ) {
30
+ println ! ( "cargo:rustc-cfg=slab_no_const_generics" ) ;
31
+ }
27
32
}
Original file line number Diff line number Diff line change @@ -810,6 +810,7 @@ impl<T> Slab<T> {
810
810
/// Returns mutable references to many indices at once.
811
811
/// Returns [`GetDisjointMutError`] if the indices are out of bounds,
812
812
/// overlapping, or vacant.
813
+ #[ cfg( not( slab_no_const_generics) ) ]
813
814
pub fn get_disjoint_mut < const N : usize > (
814
815
& mut self ,
815
816
keys : [ usize ; N ] ,
Original file line number Diff line number Diff line change @@ -735,6 +735,7 @@ fn clone_from() {
735
735
assert ! ( slab2. capacity( ) >= 10 ) ;
736
736
}
737
737
738
+ #[ rustversion:: since( 1.51 ) ]
738
739
#[ test]
739
740
fn get_disjoint_mut ( ) {
740
741
let mut slab = Slab :: from_iter ( ( 0 ..5 ) . enumerate ( ) ) ;
You can’t perform that action at this time.
0 commit comments