Skip to content

Commit f39a2c5

Browse files
committed
Merge pull request #318 from csherratt/fix_master
Update for rust-lang/rust#16453
2 parents b75436b + 391306e commit f39a2c5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/device/gl/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl ::Device for GlDevice {
400400
::BufferHandle::from_raw(::Handle(name, info))
401401
}
402402

403-
fn create_buffer_static<T>(&mut self, data: &::Blob<T>) -> ::BufferHandle<T> {
403+
fn create_buffer_static<'a, T>(&mut self, data: &::Blob<T>+'a) -> ::BufferHandle<T> {
404404
let name = self.create_buffer_internal();
405405
let info = ::BufferInfo {
406406
usage: ::UsageStatic,

src/device/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub trait Blob<T> {
179179
/// Helper trait for casting &Blob
180180
pub trait RefBlobCast<'a> {
181181
/// Cast the type the blob references
182-
fn cast<U>(self) -> &'a Blob<U>;
182+
fn cast<U>(self) -> &'a Blob<U>+'a;
183183
}
184184

185185
/// Helper trait for casting Box<Blob>
@@ -188,8 +188,8 @@ pub trait BoxBlobCast {
188188
fn cast<U>(self) -> Box<Blob<U> + Send>;
189189
}
190190

191-
impl<'a, T> RefBlobCast<'a> for &'a Blob<T> {
192-
fn cast<U>(self) -> &'a Blob<U> {
191+
impl<'a, T> RefBlobCast<'a> for &'a Blob<T>+'a {
192+
fn cast<U>(self) -> &'a Blob<U>+'a {
193193
unsafe { std::mem::transmute(self) }
194194
}
195195
}

src/examples/cube/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ fn main() {
172172
];
173173

174174
let slice = {
175-
let buf = device.create_buffer_static(&index_data);
175+
let buf = device.create_buffer_static(&index_data.as_slice());
176176
gfx::IndexSlice8(gfx::TriangleList, buf, 0, 36)
177177
};
178178

@@ -187,7 +187,7 @@ fn main() {
187187
let image_info = texture_info.to_image_info();
188188
let texture = device.create_texture(texture_info).unwrap();
189189
device.update_texture(&texture, &image_info,
190-
&vec![0x20u8, 0xA0u8, 0xC0u8, 0x00u8])
190+
&vec![0x20u8, 0xA0u8, 0xC0u8, 0x00u8].as_slice())
191191
.unwrap();
192192

193193
let sampler = device.create_sampler(

0 commit comments

Comments
 (0)