Don't consume self when calling root on a Temporary<T>.

Fixes issue #5540.
This commit is contained in:
Aneesh Agrawal 2015-04-06 18:57:06 -04:00
parent 3c5c2f416b
commit 04468a53df

View file

@ -173,7 +173,7 @@ impl<T: Reflectable> Temporary<T> {
}
/// Create a stack-bounded root for this value.
pub fn root(self) -> Root<T> {
pub fn root(&self) -> Root<T> {
STACK_ROOTS.with(|ref collection| {
let RootCollectionPtr(collection) = collection.get().unwrap();
unsafe {