Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
- --> src/render.rs:45:34
- |
- 45 | self.texture_creator.create_texture_from_surface(
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 40:5...
- --> src/render.rs:40:5
- |
- 40 | / fn create_light_texture(&mut self) {
- 41 | | let light_radius = ((VISIBILITY_RADIUS as f32 - 1. / 2_f32.sqrt()) * CELL_SIZE as f32) as u32;
- 42 | | let texture_size = 1024;
- 43 | | let light_surface = create_light_surface(light_radius, texture_size).unwrap();
- ... |
- 49 | |
- 50 | | }
- | |_____^
- note: ...so that reference does not outlive borrowed content
- --> src/render.rs:45:13
- |
- 45 | self.texture_creator.create_texture_from_surface(
- | ^^^^^^^^^^^^^^^^^^^^
- note: but, the lifetime must be valid for the lifetime 'c as defined on the impl at 31:6...
- --> src/render.rs:31:6
- |
- 31 | impl<'c> Renderer<'c> {
- | ^^
- = note: ...so that the expression is assignable:
- expected std::option::Option<sdl2::render::Texture<'c>>
- found std::option::Option<sdl2::render::Texture<'_>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement