diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2021-02-04 11:17:01 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2021-02-04 11:17:01 +0100 |
| commit | da536554a0b67ef24c7f66e7b1561729d0e36b75 (patch) | |
| tree | 1712ad4ea8abf1c01caab785f7d24f3a239edb27 /compiler/rustc_codegen_llvm/src | |
| parent | fbe109a2fc365087d778d2993cfa78cb2250475d (diff) | |
| download | rust-da536554a0b67ef24c7f66e7b1561729d0e36b75.tar.gz rust-da536554a0b67ef24c7f66e7b1561729d0e36b75.zip | |
Use is_local instead of as_local
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/consts.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs index 80db614faf9..16e1a8a1242 100644 --- a/compiler/rustc_codegen_llvm/src/consts.rs +++ b/compiler/rustc_codegen_llvm/src/consts.rs @@ -210,7 +210,7 @@ impl CodegenCx<'ll, 'tcx> { debug!("get_static: sym={} instance={:?} fn_attrs={:?}", sym, instance, fn_attrs); - let g = if def_id.as_local().is_some() && !self.tcx.is_foreign_item(def_id) { + let g = if def_id.is_local() && !self.tcx.is_foreign_item(def_id) { let llty = self.layout_of(ty).llvm_type(self); if let Some(g) = self.get_declared_value(sym) { if self.val_ty(g) != self.type_ptr_to(llty) { @@ -241,7 +241,7 @@ impl CodegenCx<'ll, 'tcx> { llvm::set_thread_local_mode(g, self.tls_model); } - if def_id.as_local().is_none() { + if !def_id.is_local() { let needs_dll_storage_attr = self.use_dll_storage_attrs && !self.tcx.is_foreign_item(def_id) && // ThinLTO can't handle this workaround in all cases, so we don't // emit the attrs. Instead we make them unnecessary by disallowing |
