Return shared reference from alloc method
Summary:
Currently, `DirectDeclSmartConstructors::alloc` returns a `&mut T`, because `bumpalo::Bump::alloc` does. This could be useful in some applications, but it isn't in the direct decl parser--we never mutate a value after allocating it. Furthermore, we occasionally need to use `&*` to convert the mutable reference to a shared one, in situations where rustc does not have sufficient context to infer that the coercion is necessary.
Instead, just do the coercion in the `alloc` function by declaring it as returning a `&T`. If we find a use case where mutability after allocation would be helpful, we could always add an `alloc_mut` method.
Reviewed By: Wilfred
Differential Revision:
D21645147
fbshipit-source-id:
35b6cc9dcfefa941ccd17422390253bef6bcb673