WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 44a07b9

Browse files
authored
Fix MSRV build (#292)
* Fix MSRV build Criterion started pulling in new versions of `rayon` that have a more recent MSRV than we do. * Fix compilation error on newer rustc nightlies * Fix new rustc warning about hidden lifetimes * Fix test to use new Box allocator-api methods `Box::into_raw` doesn't work with custom allocators anymore.
1 parent 573ed78 commit 44a07b9

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ serde = { version = "1.0.197", features = ["derive"] }
5353
serde_json = "1.0.115"
5454
blink-alloc = { version = "=0.3.1" }
5555

56+
# Make sure that criterion pulls in a rayon that supports our MSRV.
57+
rayon = { version = "=1.10.0" }
58+
rayon-core = { version = "=1.12.1" }
59+
5660
[features]
5761
default = []
5862
collections = []

src/collections/vec.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ impl<'bump, T: 'bump> Vec<'bump, T> {
15811581
/// v.drain(..);
15821582
/// assert_eq!(v, &[]);
15831583
/// ```
1584-
pub fn drain<R>(&mut self, range: R) -> Drain<T>
1584+
pub fn drain<'a, R>(&'a mut self, range: R) -> Drain<'a, 'bump, T>
15851585
where
15861586
R: RangeBounds<usize>,
15871587
{
@@ -2383,7 +2383,11 @@ impl<'bump, T: 'bump> Vec<'bump, T> {
23832383
/// assert_eq!(u, &[1, 2]);
23842384
/// ```
23852385
#[inline]
2386-
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter>
2386+
pub fn splice<'a, R, I>(
2387+
&'a mut self,
2388+
range: R,
2389+
replace_with: I,
2390+
) -> Splice<'a, 'bump, I::IntoIter>
23872391
where
23882392
R: RangeBounds<usize>,
23892393
I: IntoIterator<Item = T>,
@@ -2761,7 +2765,11 @@ impl<'a, 'bump, T> FusedIterator for Drain<'a, 'bump, T> {}
27612765
/// This struct is created by the [`Vec::splice`] method. See its
27622766
/// documentation for more information.
27632767
#[derive(Debug)]
2764-
pub struct Splice<'a, 'bump, I: Iterator + 'a + 'bump> {
2768+
pub struct Splice<'a, 'bump, I>
2769+
where
2770+
I: Iterator,
2771+
I::Item: 'a + 'bump,
2772+
{
27652773
drain: Drain<'a, 'bump, I::Item>,
27662774
replace_with: I,
27672775
}

tests/all/tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ fn test_chunk_capacity() {
221221
#[test]
222222
#[cfg(feature = "allocator_api")]
223223
fn miri_stacked_borrows_issue_247() {
224-
let bump = bumpalo::Bump::new();
224+
let bump = Bump::new();
225225

226-
let a = Box::into_raw(Box::new_in(1u8, &bump));
227-
drop(unsafe { Box::from_raw_in(a, &bump) });
226+
let (p, _) = Box::into_raw_with_allocator(Box::new_in(1u8, &bump));
227+
drop(unsafe { Box::from_raw_in(p, &bump) });
228228

229-
let _b = Box::new_in(2u16, &bump);
229+
let _q = Box::new_in(2u16, &bump);
230230
}

0 commit comments

Comments
 (0)