Rollup merge of #62422 - lzutao:remove-some-mem-uinit, r=alexcrichton

Remove some uses of mem::uninitialized

cc #62397
r? @RalfJung
This commit is contained in:
Mazdak Farrokhzad 2019-07-06 22:14:38 +02:00 committed by GitHub
commit 30e4a874cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 11 deletions

View file

@ -170,8 +170,7 @@ impl CodegenCx<'ll, 'tcx> {
pub fn const_get_real(&self, v: &'ll Value) -> Option<(f64, bool)> {
unsafe {
if self.is_const_real(v) {
#[allow(deprecated)]
let mut loses_info: llvm::Bool = ::std::mem::uninitialized();
let mut loses_info: llvm::Bool = 0;
let r = llvm::LLVMConstRealGetDouble(v, &mut loses_info);
let loses_info = if loses_info == 1 { true } else { false };
Some((r, loses_info))