Skip to content

Commit

Permalink
Update to nightly 2022-02-08
Browse files Browse the repository at this point in the history
Specify more explicit types to workaround GAT inference problems
  • Loading branch information
Techcable committed Feb 14, 2022
1 parent c3e1955 commit fb9a554
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libs/context/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ unsafe impl<C> GcSimpleAlloc for CollectorContext<C>

#[inline]
fn alloc_raw_vec_with_capacity<'gc, T>(&'gc self, capacity: usize) -> C::RawVec<'gc, T> where T: GcSafe<'gc, CollectorId<C>> {
C::alloc_raw_vec_with_capacity(self, capacity)
C::alloc_raw_vec_with_capacity::<T>(self, capacity)
}
}

Expand Down
2 changes: 1 addition & 1 deletion libs/simple/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ unsafe impl<'gc, T: GcSafe<'gc, crate::CollectorId>> IGcVec<'gc, T> for SimpleVe

#[inline]
pub fn with_capacity_in(capacity: usize, ctx: &'gc crate::SimpleCollectorContext) -> Self {
ctx.alloc_raw_vec_with_capacity(capacity)
ctx.alloc_raw_vec_with_capacity::<T>(capacity)
}

#[inline]
Expand Down
3 changes: 1 addition & 2 deletions libs/simple/tests/trait_objects.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(thread_local_const_init)]
use core::cell::Cell;

use zerogc::{Trace, safepoint, DynTrace, trait_object_trace, GcSimpleAlloc};
Expand Down Expand Up @@ -73,4 +72,4 @@ fn foo_bar() {
// Trace inner, should end up dropping Bar
safepoint!(context, ());
assert_eq!(BAR_DROP_COUNT.with(Cell::get), 2, "Expected Bar to be dropped");
}
}
4 changes: 2 additions & 2 deletions src/epsilon/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ unsafe impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> IGcVec<'gc, T> for EpsilonR

#[inline]
pub fn with_capacity_in(capacity: usize, ctx: &'gc EpsilonContext) -> Self {
ctx.alloc_raw_vec_with_capacity(capacity)
ctx.alloc_raw_vec_with_capacity::<T>(capacity)
}

#[inline]
Expand Down Expand Up @@ -307,4 +307,4 @@ impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> Extend<T> for EpsilonRawVec<'gc, T
self.push(val);
}
}
}
}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ pub unsafe trait GcSimpleAlloc: GcContext {
fn alloc_vec<'gc, T>(&'gc self) -> GcVec<'gc, T, Self::Id>
where T: GcSafe<'gc, Self::Id> {
unsafe {
crate::vec::GcVec::from_raw(self.alloc_raw_vec_with_capacity(0))
crate::vec::GcVec::from_raw(self.alloc_raw_vec_with_capacity::<T>(0))
}
}
/// Allocate a new [GcVec] with the specified capacity
Expand All @@ -601,7 +601,7 @@ pub unsafe trait GcSimpleAlloc: GcContext {
fn alloc_vec_with_capacity<'gc, T>(&'gc self, capacity: usize) -> GcVec<'gc, T, Self::Id>
where T: GcSafe<'gc, Self::Id> {
unsafe {
crate::vec::GcVec::from_raw(self.alloc_raw_vec_with_capacity(capacity))
crate::vec::GcVec::from_raw(self.alloc_raw_vec_with_capacity::<T>(capacity))
}
}
}
Expand Down

0 comments on commit fb9a554

Please sign in to comment.