Change lib to &[Shared<Module>] and remove dummy lifetimes.

This commit is contained in:
Stephen Chung
2022-11-07 16:18:59 +08:00
parent 4455d95abc
commit 0c79471fd3
16 changed files with 93 additions and 94 deletions

View File

@@ -195,7 +195,7 @@ impl Engine {
global.debugger.status = crate::eval::DebuggerStatus::Terminate;
let lib = &[
#[cfg(not(feature = "no_function"))]
ast.as_ref(),
AsRef::<crate::Shared<_>>::as_ref(ast).clone(),
];
let node = &crate::ast::Stmt::Noop(Position::NONE);
self.run_debugger(global, caches, lib, 0, scope, &mut None, node)?;
@@ -234,7 +234,7 @@ impl Engine {
let mut _lib = &[
#[cfg(not(feature = "no_function"))]
ast.as_ref(),
AsRef::<crate::Shared<_>>::as_ref(ast).clone(),
][..];
#[cfg(not(feature = "no_function"))]
if !ast.has_functions() {
@@ -264,7 +264,7 @@ impl Engine {
&self,
global: &mut GlobalRuntimeState,
caches: &mut Caches,
lib: &[&crate::Module],
lib: &[crate::Shared<crate::Module>],
level: usize,
scope: &mut Scope,
statements: &[crate::ast::Stmt],