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

Fix SIGILL on nightly rustc #101

Merged
merged 2 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Swtich to maybe-uninit for backward compatibility
  • Loading branch information
ishitatsuyuki committed Jul 22, 2019
commit e9cc5bbf311c6dbd0295b18cd413efbfa0d9d695
1 change: 1 addition & 0 deletions x11-dl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ workspace = ".."
[dependencies]
lazy_static = "1"
libc = "0.2"
maybe-uninit = "2.0.0"

[build-dependencies]
pkg-config = "0.3.8"
1 change: 1 addition & 0 deletions x11-dl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
extern crate lazy_static;

extern crate libc;
extern crate maybe_uninit;

#[macro_use]
mod link;
Expand Down
2 changes: 1 addition & 1 deletion x11-dl/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ macro_rules! x11_link {
unsafe {
let libdir = $crate::link::config::libdir::$pkg_name;
let lib = try!($crate::link::DynamicLibrary::open_multi(libdir, &[$($lib_name),*]));
let mut this = ::std::mem::MaybeUninit::<$struct_name>::uninit();
let mut this = ::maybe_uninit::MaybeUninit::<$struct_name>::uninit();
let this_ptr = this.as_mut_ptr();
::std::ptr::write(&mut (*this_ptr).lib, lib);
try!(Self::init(this_ptr));
Expand Down