Skip to content

Commit f43ea86

Browse files
committed
conditionally include std in the ffi crate
1 parent da684b8 commit f43ea86

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pyo3-ffi/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,21 @@
371371
clippy::missing_safety_doc,
372372
clippy::ptr_eq
373373
)]
374+
#![warn(
375+
clippy::alloc_instead_of_core,
376+
clippy::std_instead_of_alloc,
377+
clippy::std_instead_of_core
378+
)]
374379
#![warn(elided_lifetimes_in_paths, unused_lifetimes)]
375380
// This crate is a hand-maintained translation of CPython's headers, so requiring "unsafe"
376381
// blocks within those translations increases maintenance burden without providing any
377382
// additional safety. The safety of the functions in this crate is determined by the
378383
// original CPython headers
379384
#![allow(unsafe_op_in_unsafe_fn)]
380385

386+
#[cfg(not(any(Py_3_14, target_arch = "wasm32")))]
387+
extern crate std;
388+
381389
// Until `extern type` is stabilized, use the recommended approach to
382390
// model opaque types:
383391
// https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs

0 commit comments

Comments
 (0)