Merge pull request #436 from tomaka/uninit-doctests

More removal of uninitialized in doctests
This commit is contained in:
tomaka 2017-05-06 14:27:54 +02:00 committed by GitHub
commit 698e0cc9ae
8 changed files with 24 additions and 26 deletions

View File

@ -31,8 +31,7 @@ use device::Queue;
///
/// ```ignore // FIXME: unignore
/// use vulkano::buffer::BufferSlice;
/// # let buffer: std::sync::Arc<vulkano::buffer::DeviceLocalBuffer<[u8]>> =
/// unsafe { std::mem::uninitialized() };
/// # let buffer: std::sync::Arc<vulkano::buffer::DeviceLocalBuffer<[u8]>> = return;
/// let _slice = BufferSlice::from(&buffer);
/// ```
///
@ -40,8 +39,7 @@ use device::Queue;
///
/// ```ignore // FIXME: unignore
/// use vulkano::buffer::BufferSlice;
/// # let buffer: std::sync::Arc<vulkano::buffer::DeviceLocalBuffer<[u8]>> =
/// unsafe { std::mem::uninitialized() };
/// # let buffer: std::sync::Arc<vulkano::buffer::DeviceLocalBuffer<[u8]>> = return;
/// let _slice = BufferSlice::from(&buffer).slice(12 .. 14).unwrap();
/// ```
///

View File

@ -17,15 +17,15 @@
//!
//! # Example
//!
//! ```no_run
//! ```
//! # use std::sync::Arc;
//! use vulkano::buffer::immutable::ImmutableBuffer;
//! use vulkano::buffer::sys::Usage;
//! use vulkano::buffer::BufferView;
//! use vulkano::format;
//!
//! # let device: Arc<vulkano::device::Device> = unsafe { std::mem::uninitialized() };
//! # let queue: Arc<vulkano::device::Queue> = unsafe { std::mem::uninitialized() };
//! # let device: Arc<vulkano::device::Device> = return;
//! # let queue: Arc<vulkano::device::Queue> = return;
//! let usage = Usage {
//! storage_texel_buffer: true,
//! .. Usage::none()

View File

@ -19,8 +19,8 @@ macro_rules! features {
///
/// # Example
///
/// ```no_run
/// # let physical_device: vulkano::instance::PhysicalDevice = unsafe { ::std::mem::uninitialized() };
/// ```
/// # let physical_device: vulkano::instance::PhysicalDevice = return;
/// let minimal_features = vulkano::instance::Features {
/// geometry_shader: true,
/// .. vulkano::instance::Features::none()

View File

@ -19,10 +19,10 @@
//!
//! # Example
//!
//! ```no_run
//! ```
//! # use vulkano::instance::Instance;
//! # use std::sync::Arc;
//! # let instance: Arc<Instance> = unsafe { ::std::mem::uninitialized() };
//! # let instance: Arc<Instance> = return;
//! use vulkano::instance::debug::DebugCallback;
//!
//! let _callback = DebugCallback::errors_and_warnings(&instance, |msg| {

View File

@ -18,9 +18,9 @@
//! A physical device is composed of one or more **memory heaps**. A memory heap is a pool of
//! memory that can be allocated.
//!
//! ```no_run
//! ```
//! // Enumerating memory heaps.
//! # let physical_device: vulkano::instance::PhysicalDevice = unsafe { std::mem::uninitialized() };
//! # let physical_device: vulkano::instance::PhysicalDevice = return;
//! for heap in physical_device.memory_heaps() {
//! println!("Heap #{:?} has a capacity of {:?} bytes", heap.id(), heap.size());
//! }
@ -35,9 +35,9 @@
//! memory type has a much quicker access time from the GPU than a non-device-local type. Note
//! that non-device-local memory types are still accessible by the device, they are just slower.
//!
//! ```no_run
//! ```
//! // Enumerating memory types.
//! # let physical_device: vulkano::instance::PhysicalDevice = unsafe { std::mem::uninitialized() };
//! # let physical_device: vulkano::instance::PhysicalDevice = return;
//! for ty in physical_device.memory_types() {
//! println!("Memory type belongs to heap #{:?}", ty.heap().id());
//! println!("Host-accessible: {:?}", ty.is_host_visible());
@ -64,10 +64,10 @@
//!
//! Here is an example:
//!
//! ```no_run
//! ```
//! use vulkano::memory::DeviceMemory;
//!
//! # let device: std::sync::Arc<vulkano::device::Device> = unsafe { std::mem::uninitialized() };
//! # let device: std::sync::Arc<vulkano::device::Device> = return;
//! // Taking the first memory type for the sake of this example.
//! let ty = device.physical_device().memory_types().next().unwrap();
//!

View File

@ -42,8 +42,8 @@
//! use vulkano::buffer::Usage as BufferUsage;
//! use vulkano::memory::HostVisible;
//! use vulkano::pipeline::vertex::;
//! # let device: Arc<Device> = unsafe { std::mem::uninitialized() };
//! # let queue: Arc<Queue> = unsafe { std::mem::uninitialized() };
//! # let device: Arc<Device> = return;
//! # let queue: Arc<Queue> = return;
//!
//! struct Vertex {
//! position: [f32; 2]

View File

@ -21,19 +21,19 @@
//!
//! A simple sampler for most usages:
//!
//! ```no_run
//! ```
//! use vulkano::sampler::Sampler;
//!
//! # let device: std::sync::Arc<vulkano::device::Device> = unsafe { ::std::mem::uninitialized() };
//! # let device: std::sync::Arc<vulkano::device::Device> = return;
//! let _sampler = Sampler::simple_repeat_linear_no_mipmap(&device);
//! ```
//!
//! More detailed sampler creation:
//!
//! ```no_run
//! ```
//! use vulkano::sampler;
//!
//! # let device: std::sync::Arc<vulkano::device::Device> = unsafe { ::std::mem::uninitialized() };
//! # let device: std::sync::Arc<vulkano::device::Device> = return;
//! let _sampler = sampler::Sampler::new(&device, sampler::Filter::Linear, sampler::Filter::Linear,
//! sampler::MipmapMode::Nearest,
//! sampler::SamplerAddressMode::Repeat,

View File

@ -154,14 +154,14 @@
//!
//! TODO: suboptimal stuff
//!
//! ```no_run
//! ```
//! # use std::time::Duration;
//! use vulkano::swapchain::AcquireError;
//! use vulkano::sync::GpuFuture;
//!
//! // let mut swapchain = Swapchain::new(...);
//! # let mut swapchain: (::std::sync::Arc<::vulkano::swapchain::Swapchain>, _) = unsafe { ::std::mem::uninitialized() };
//! # let queue: ::std::sync::Arc<::vulkano::device::Queue> = unsafe { ::std::mem::uninitialized() };
//! # let mut swapchain: (::std::sync::Arc<::vulkano::swapchain::Swapchain>, _) = return;
//! # let queue: ::std::sync::Arc<::vulkano::device::Queue> = return;
//! let mut recreate_swapchain = false;
//!
//! loop {