Support the rustc in the latest Ubuntu LTS.

At this time, this is Bionic, with Rust 1.25.0.
This commit is contained in:
Dan Gohman
2018-07-13 16:19:48 -07:00
parent 202e45c213
commit 2db2d946b8
5 changed files with 20 additions and 12 deletions

View File

@@ -229,14 +229,14 @@ impl<T: EntityRef> EntityList<T> {
pub fn from_slice(slice: &[T], pool: &mut ListPool<T>) -> Self {
let len = slice.len();
if len == 0 {
return EntityList::new();
return Self::new();
}
let block = pool.alloc(sclass_for_length(len));
pool.data[block] = T::new(len);
pool.data[block + 1..block + len + 1].copy_from_slice(slice);
EntityList {
Self {
index: (block + 1) as u32,
unused: PhantomData,
}