Remove Obj::into_gc() and have Obj ctors return a Gc instead
Since we're nightly and using coerce_unsized, we can just coerce a Gc<T: Obj> into a Gc<dyn Obj> for free. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::obj::{Obj, VTable};
|
||||
use crate::syn::ast::SpStmt;
|
||||
use crate::vm::{error::*, machine::Machine};
|
||||
use crate::{scope::Scope, syn::span::Span, vm::inst::SpInst};
|
||||
use gc::{unsafe_empty_trace, Finalize, Trace};
|
||||
use gc::{unsafe_empty_trace, Finalize, Gc, Trace};
|
||||
use std::fmt::Debug;
|
||||
use std::rc::Rc;
|
||||
|
||||
@@ -27,11 +27,11 @@ pub struct QuoteObj {
|
||||
}
|
||||
|
||||
impl QuoteObj {
|
||||
pub fn new(value: Quote) -> Self {
|
||||
QuoteObj {
|
||||
pub fn new(value: Quote) -> Gc<Self> {
|
||||
Gc::new(QuoteObj {
|
||||
value,
|
||||
vtable: vtable! {},
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
||||
Reference in New Issue
Block a user