[rust] fix some miri errors #1937

`cargo +nightly miri test --no-fail-fast -- --test-threads 1 --nocapture`
This commit is contained in:
joseLuís 2021-07-17 15:07:19 +02:00
parent 8c1fd5b16d
commit 6e85a3c7ea
2 changed files with 11 additions and 1 deletions

View File

@ -17,6 +17,8 @@ fn main() {
// The bindgen::Builder is the main entry point to bindgen, and lets you
// build up options for the resulting bindings.
//
// https://docs.rs/bindgen/*/bindgen/struct.Builder.html
//
// allow .blacklist_function instead of .blocklist_function for now,
// until we update bindgen to >= 0.58.
#[allow(deprecated)]
@ -48,6 +50,9 @@ fn main() {
.blacklist_item("MSG_.*")
.blacklist_item("N[^C].*")
.blacklist_type("_bindgen.*")
// https://github.com/dankamongmen/notcurses/pull/1937
// https://github.com/rust-lang/rust-bindgen/issues/1651
.layout_tests(false)
// Don't derive the Copy trait on types with destructors.
.no_copy("ncdirect")
.no_copy("ncdplot")

View File

@ -21,6 +21,7 @@
//! ```rust
//! use libnotcurses_sys::*;
//!
//! # #[cfg(not(miri))]
//! fn main() -> NcResult<()> {
//! let mut nc = Nc::with_flags(NCOPTION_NO_ALTERNATE_SCREEN)?;
//! let plane = nc.stdplane();
@ -29,6 +30,8 @@
//! nc.stop()?;
//! Ok(())
//! }
//! # #[cfg(miri)]
//! # fn main() {}
//! ```
//!
//! Although you still have to manually call the `stop()` method for [`Nc`] and
@ -66,6 +69,7 @@
//!
//! use libnotcurses_sys::*;
//!
//! # #[cfg(not(miri))]
//! fn main() {
//! let options = ffi::notcurses_options {
//! termtype: null(),
@ -93,7 +97,8 @@
//! }
//! }
//! }
//!
//! # #[cfg(miri)]
//! # fn main() {}
//! ```
//!
//! ### The `notcurses` C API docs