Bug 1449159 - Move the allow(improper_ctypes) attribute to be more scoped. r?jrmuizel
Apparently applying it on an individual function inside the extern "C"
block doesn't work so we have to apply it to the whole block. But that's
better than applying it to the whole crate.
MozReview-Commit-ID: GUMliaZragl
--- a/gfx/webrender_bindings/src/moz2d_renderer.rs
+++ b/gfx/webrender_bindings/src/moz2d_renderer.rs
@@ -1,9 +1,8 @@
-#![allow(improper_ctypes)] // this is needed so that rustc doesn't complain about passing the &Arc<Vec> to an extern function
use webrender::api::*;
use bindings::{ByteSlice, MutByteSlice, wr_moz2d_render_cb, ArcVecU8};
use rayon::ThreadPool;
use std::collections::hash_map::{HashMap, Entry};
use std::mem;
use std::os::raw::c_void;
use std::ptr;
@@ -443,18 +442,19 @@ impl BlobImageRenderer for Moz2dImageRen
unsafe { DeleteFontData(font); }
}
fn delete_font_instance(&mut self, _key: FontInstanceKey) {
}
}
use bindings::WrFontKey;
+
+#[allow(improper_ctypes)] // this is needed so that rustc doesn't complain about passing the &Arc<Vec> to an extern function
extern "C" {
- #[allow(improper_ctypes)]
fn AddFontData(key: WrFontKey, data: *const u8, size: usize, index: u32, vec: &ArcVecU8);
fn AddNativeFontHandle(key: WrFontKey, handle: *mut c_void, index: u32);
fn DeleteFontData(key: WrFontKey);
}
impl Moz2dImageRenderer {
pub fn new(workers: Arc<ThreadPool>) -> Self {
let (tx, rx) = channel();