Skip to content

Commit

Permalink
Make it compile, at least.
Browse files Browse the repository at this point in the history
Since last commit, Rust changed the behavior of `extern static`; see
rust-lang/rust#35112

In the future, this should be change to an unsafe block, but now it suffices to turn off the error by the `#[allow(...)]` switch.
  • Loading branch information
EQt committed Aug 20, 2018
1 parent 10025d3 commit b8f357c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions libhdf5-sys/src/h5e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ extern {

pub use self::globals::*;

#[allow(safe_extern_statics)]
#[cfg(not(target_env = "msvc"))]
mod globals {
pub use h5i::hid_t as id_t;
Expand Down
1 change: 1 addition & 0 deletions libhdf5-sys/src/h5g.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl Default for H5G_info_t {
fn default() -> H5G_info_t { unsafe { ::std::mem::zeroed() } }
}

#[allow(safe_extern_statics)]
extern {
pub fn H5Gcreate2(loc_id: hid_t, name: *const c_char, lcpl_id: hid_t, gcpl_id: hid_t, gapl_id:
hid_t) -> hid_t;
Expand Down
1 change: 1 addition & 0 deletions libhdf5-sys/src/h5p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ mod globals {
pub static H5P_LST_LINK_ACCESS: &'static id_t = &H5P_LST_LINK_ACCESS_g;
}

#[allow(safe_extern_statics)]
#[cfg(all(hdf5_1_8_14, not(target_env = "msvc")))]
mod globals {
pub use h5i::hid_t as id_t;
Expand Down
1 change: 1 addition & 0 deletions libhdf5-sys/src/h5t.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ extern {

pub use self::globals::*;

#[allow(safe_extern_statics)]
#[cfg(not(target_env = "msvc"))]
mod globals {
pub use h5i::hid_t as id_t;
Expand Down

0 comments on commit b8f357c

Please sign in to comment.