Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated methods and types #5148

Merged
merged 4 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//!
//! Ready?

use wasmer::{imports, wat2wasm, EngineBuilder, Instance, Module, Store, Value};
use wasmer::{imports, sys::EngineBuilder, wat2wasm, Instance, Module, Store, Value};
use wasmer_compiler_cranelift::Cranelift;

fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
2 changes: 1 addition & 1 deletion examples/engine_cross_compilation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Ready?

use std::str::FromStr;
use wasmer::{wat2wasm, EngineBuilder, Module, RuntimeError, Store};
use wasmer::{sys::EngineBuilder, wat2wasm, Module, RuntimeError, Store};
use wasmer_compiler_cranelift::Cranelift;
use wasmer_types::{CpuFeature, Target, Triple};

Expand Down
2 changes: 1 addition & 1 deletion examples/engine_headless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
//! Ready?

use tempfile::NamedTempFile;
use wasmer::{imports, wat2wasm, EngineBuilder, Instance, Module, Store, Value};
use wasmer::{imports, sys::EngineBuilder, wat2wasm, Instance, Module, Store, Value};
use wasmer_compiler_cranelift::Cranelift;

fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
2 changes: 1 addition & 1 deletion examples/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//!
//! Ready?

use wasmer::{imports, wat2wasm, EngineBuilder, Features, Instance, Module, Store, Value};
use wasmer::{imports, sys::EngineBuilder, wat2wasm, Features, Instance, Module, Store, Value};
use wasmer_compiler_cranelift::Cranelift;

fn main() -> anyhow::Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion examples/metering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use anyhow::bail;
use std::sync::Arc;
use wasmer::wasmparser::Operator;
use wasmer::CompilerConfig;
use wasmer::{imports, wat2wasm, EngineBuilder, Instance, Module, Store, TypedFunction};
use wasmer::{imports, sys::EngineBuilder, wat2wasm, Instance, Module, Store, TypedFunction};
use wasmer_compiler_cranelift::Cranelift;
use wasmer_middlewares::{
metering::{get_remaining_points, set_remaining_points, MeteringPoints},
Expand Down
6 changes: 0 additions & 6 deletions lib/api/src/js/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ impl VMMemory {
Ok(self.clone())
}

/// Copies this memory to a new memory
#[deprecated = "use `copy` instead"]
pub fn duplicate(&mut self) -> Result<VMMemory, wasmer_types::MemoryError> {
self.copy()
}

/// Copies this memory to a new memory
pub fn copy(&mut self) -> Result<VMMemory, wasmer_types::MemoryError> {
let new_memory = crate::js::externals::memory::Memory::js_memory_from_type(&self.ty)?;
Expand Down
2 changes: 1 addition & 1 deletion lib/api/src/jsc/externals/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl Memory {

#[allow(unused)]
pub fn duplicate(&mut self, store: &impl AsStoreRef) -> Result<VMMemory, MemoryError> {
self.handle.duplicate(store)
self.handle.copy(store)
}

pub fn as_shared(&self, _store: &impl AsStoreRef) -> Option<crate::SharedMemory> {
Expand Down
9 changes: 0 additions & 9 deletions lib/api/src/jsc/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ impl VMMemory {
Ok(self.clone())
}

/// Copies this memory to a new memory
#[deprecated = "use `copy` instead"]
pub fn duplicate(
&mut self,
store: &impl AsStoreRef,
) -> Result<VMMemory, wasmer_types::MemoryError> {
self.copy(store)
}

/// Copies this memory to a new memory
pub fn copy(&self, store: &impl AsStoreRef) -> Result<VMMemory, wasmer_types::MemoryError> {
let new_memory =
Expand Down
24 changes: 0 additions & 24 deletions lib/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,30 +471,6 @@ pub mod sys;
/// Re-export `sys` definitions.
pub use sys::*;

#[cfg(feature = "sys")]
#[deprecated(note = "wasmer::Artifact is deprecated, use wasmer::sys::Artifact instead")]
/// A compiled wasm module, ready to be instantiated.
pub type Artifact = sys::Artifact;
#[cfg(feature = "sys")]
#[deprecated(note = "wasmer::EngineBuilder is deprecated, use wasmer::sys::EngineBuilder instead")]
/// The Builder contents of `Engine`
pub type EngineBuilder = sys::EngineBuilder;
#[cfg(feature = "sys")]
#[deprecated(note = "wasmer::Features is deprecated, use wasmer::sys::Features instead")]
/// Controls which experimental features will be enabled.
pub type Features = sys::Features;
#[cfg(feature = "sys")]
#[deprecated(note = "wasmer::BaseTunables is deprecated, use wasmer::sys::BaseTunables instead")]
/// Tunable parameters for WebAssembly compilation.
/// This is the reference implementation of the `Tunables` trait,
/// used by default.
pub type BaseTunables = sys::BaseTunables;
#[cfg(feature = "sys")]
#[deprecated(note = "wasmer::VMConfig is deprecated, use wasmer::sys::VMConfig instead")]
/// Configuration for the runtime VM
/// Currently only the stack size is configurable
pub type VMConfig = sys::VMConfig;

#[cfg(feature = "js")]
/// The `js` engine.
mod js;
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler-cranelift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This crate contains a compiler implementation based on Cranelift.
## Usage

```rust
use wasmer::{Store, EngineBuilder};
use wasmer::{Store, sys::EngineBuilder};
use wasmer_compiler_cranelift::Cranelift;

let compiler = Cranelift::new();
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler-singlepass/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This crate contains a compiler implementation based on the Singlepass linear com
## Usage

```rust
use wasmer::{Store, EngineBuilder};
use wasmer::{Store, sys::EngineBuilder};
use wasmer_compiler_singlepass::Singlepass;

let compiler = Singlepass::new();
Expand Down
18 changes: 0 additions & 18 deletions lib/compiler/src/engine/artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,17 +635,6 @@ impl<'a> DataInitializerLocationLike for DataInitializerLocationVariant<'a> {
}

impl Artifact {
/// Register thie `Artifact` stack frame information into the global scope.
///
/// This is not required anymore as it's done automaticaly when creating by 'Artifact::from_parts'
#[deprecated(
since = "4.0.0",
note = "done automaticaly by Artifact::from_parts, use 'take_frame_info_registration' if you use this method"
)]
pub fn register_frame_info(&mut self) -> Result<(), DeserializeError> {
self.internal_register_frame_info()
}

fn internal_register_frame_info(&mut self) -> Result<(), DeserializeError> {
if self
.allocated
Expand Down Expand Up @@ -700,13 +689,6 @@ impl Artifact {
Ok(())
}

/// The GlobalFrameInfoRegistration needs to be transfered to EngineInner if
/// register_frame_info has been used.
#[deprecated(since = "4.0.0", note = "done automaticaly by Artifact::from_parts.")]
pub fn take_frame_info_registration(&mut self) -> Option<GlobalFrameInfoRegistration> {
self.internal_take_frame_info_registration()
}

fn internal_take_frame_info_registration(&mut self) -> Option<GlobalFrameInfoRegistration> {
let frame_info_registration = &mut self
.allocated
Expand Down
Loading