Skip to content

Commit

Permalink
allow(deprecated) for glib::CallbackGuard, until we formally remove it
Browse files Browse the repository at this point in the history
Rust 1.24 made it so that a panic!() won't unwind across FFI
boundaries: we won't unwind if we panic inside a Rust function
declared extern "C".

rust-lang/rust#46833

However, gnome-class does not formally mandate a particular Rust
version; we've been running on the assumption that we are running on
nightly, or "recent enough".  For now, just supress the deprecation
warnings from glib-rs, until we formalize our requirements for the
rustc version.
  • Loading branch information
adonis0302 committed Feb 27, 2018
1 parent ce69862 commit 997a34b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/glib_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ pub fn tokens_ParentClassFfi(class: &ast::Class) -> Tokens {
}

pub fn glib_callback_guard() -> Tokens {
// FIXME: remove this function if we formally declare that
// gnome-class will require Rust 1.24 or later? That version made
// glib::CallbackGuard obsolete.
quote_cs! {
#[allow(deprecated)]
let _guard = glib::CallbackGuard::new();
}
}
Expand Down

0 comments on commit 997a34b

Please sign in to comment.