AngryLawyer/rust-sdl2 — pull request #162 by seemk (2014-08-04 19:11:40+00:00)
Title: Removed undefined behaviour from pattern matching

This fixes https://github.com/AngryLawyer/rust-sdl2/issues/161. Using the & pattern when pattern matching moves the value (or creates a copy in this case) which only lives inside the match block, thus the SDL_ function receives a dangling pointer, creating undefined behaviour. See http://is.gd/gCR7HM for an example. This fixed some of the rendering problems I had with https://github.com/seemk/SDL2_text when compiling with optimizations enabled.