From a3771518deb749aedc64955d8faad90d945a6f76 Mon Sep 17 00:00:00 2001 From: jfh Date: Wed, 27 Oct 2021 21:06:48 +0300 Subject: [PATCH] Fix warnings for wasi check. --- src/shell/helper.rs | 1 + vm/src/exceptions.rs | 2 ++ vm/src/signal.rs | 1 + vm/src/stdlib/thread.rs | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shell/helper.rs b/src/shell/helper.rs index 40a4ff810..941e9e204 100644 --- a/src/shell/helper.rs +++ b/src/shell/helper.rs @@ -1,3 +1,4 @@ +#![cfg_attr(target_os = "wasi", allow(dead_code))] use rustpython_vm::builtins::{PyDictRef, PyStrRef}; use rustpython_vm::VirtualMachine; use rustpython_vm::{function::ArgIterable, PyResult, TryFromObject}; diff --git a/vm/src/exceptions.rs b/vm/src/exceptions.rs index 3307eb63b..b3694ab41 100644 --- a/vm/src/exceptions.rs +++ b/vm/src/exceptions.rs @@ -960,12 +960,14 @@ impl IntoPyException for widestring::NulError { pub(super) mod types { use crate::common::lock::PyRwLock; + #[cfg_attr(target_os = "wasi", allow(unused_imports))] use crate::{ builtins::{traceback::PyTracebackRef, PyInt, PyTupleRef, PyTypeRef}, function::{FuncArgs, IntoPyResult}, PyObjectRef, PyRef, PyResult, VirtualMachine, }; use crossbeam_utils::atomic::AtomicCell; + #[cfg_attr(target_os = "wasi", allow(unused_imports))] use std::ops::Deref; // This module is designed to be used as `use builtins::*;`. diff --git a/vm/src/signal.rs b/vm/src/signal.rs index a1aedf1b7..0da742e1e 100644 --- a/vm/src/signal.rs +++ b/vm/src/signal.rs @@ -1,3 +1,4 @@ +#![cfg_attr(target_os = "wasi", allow(dead_code))] use crate::{PyObjectRef, PyResult, VirtualMachine}; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/vm/src/stdlib/thread.rs b/vm/src/stdlib/thread.rs index e07ffefbd..fe796fc47 100644 --- a/vm/src/stdlib/thread.rs +++ b/vm/src/stdlib/thread.rs @@ -1,5 +1,5 @@ //! Implementation of the _thread module - +#[cfg_attr(target_os = "wasi", allow(unused_imports))] pub(crate) use _thread::{make_module, RawRMutex}; #[pymodule]