Add more allow(unsafe) on unsafe code from macros

This commit is contained in:
Pierre Krieger 2016-07-25 16:04:22 +02:00
parent 64b438b483
commit f1ee8c02c7
4 changed files with 9 additions and 0 deletions

View File

@ -80,6 +80,7 @@ pub fn write_entry_point(doc: &parse::Spirv, instruction: &parse::Instruction) -
let entry_point = format!(r#"
/// Returns a logical struct describing the entry point named `{ep_name}`.
#[inline]
#[allow(unsafe_code)]
pub fn {ep_name}_entry_point(&self) -> {ty} {{
unsafe {{
#[allow(dead_code)]
@ -170,6 +171,7 @@ fn write_interface_struct(struct_name: &str, attributes: &[(u32, String, (String
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct {name};
#[allow(unsafe_code)]
unsafe impl ::vulkano::pipeline::shader::ShaderInterfaceDef for {name} {{
type Iter = {name}Iter;
fn elements(&self) -> {name}Iter {{

View File

@ -117,6 +117,7 @@ pub struct {name} {{
impl {name} {{
/// Loads the shader in Vulkan as a `ShaderModule`.
#[inline]
#[allow(unsafe_code)]
pub fn load(device: &::std::sync::Arc<::vulkano::device::Device>)
-> Result<{name}, ::vulkano::OomError>
{{

View File

@ -112,6 +112,7 @@ macro_rules! ordered_passes_renderpass {
}
}
#[allow(unsafe_code)]
unsafe impl RenderPass for CustomRenderPass {
#[inline]
fn inner(&self) -> &UnsafeRenderPass {
@ -119,6 +120,7 @@ macro_rules! ordered_passes_renderpass {
}
}
#[allow(unsafe_code)]
unsafe impl RenderPassDesc for CustomRenderPass {
type AttachmentsIter = AttachmentsIter;
type PassesIter = PassesIter;
@ -360,6 +362,7 @@ macro_rules! ordered_passes_renderpass {
}
#[allow(non_camel_case_types)]
#[allow(unsafe_code)]
unsafe impl<'a, $($atch_name: 'static + ImageView),*> RenderPassAttachmentsList<AList<'a, $($atch_name),*>> for CustomRenderPass {
// TODO: shouldn't build a Vec
type AttachmentsIter = VecIntoIter<(Arc<ImageView>, Arc<Image>, Layout, Layout)>;
@ -407,6 +410,7 @@ macro_rules! ordered_passes_renderpass {
}
#[allow(non_camel_case_types)]
#[allow(unsafe_code)]
unsafe impl<$($atch: Clone + Into<<$format as $crate::format::FormatDesc>::ClearValue>),*>
RenderPassClearValues<ClearValues<$($atch),*>> for CustomRenderPass
{
@ -462,6 +466,7 @@ macro_rules! ordered_passes_renderpass {
(__impl_clear_values__ [$total:expr] [] []) => {
pub type ClearValues = ();
#[allow(unsafe_code)]
unsafe impl RenderPassClearValues<()> for CustomRenderPass {
type ClearValuesIter = ClearValuesIter;

View File

@ -448,6 +448,7 @@ unsafe impl<'a, T, U, Bt, Bu> Source<(&'a Arc<Bt>, &'a Arc<Bu>)> for OneVertexOn
#[macro_export]
macro_rules! impl_vertex {
($out:ident $(, $member:ident)*) => (
#[allow(unsafe_code)]
unsafe impl $crate::pipeline::vertex::Vertex for $out {
#[inline(always)]
fn member(name: &str) -> Option<$crate::pipeline::vertex::VertexMemberInfo> {