Skip to content

Commit da53655

Browse files
committed
Use is_local instead of as_local
1 parent fbe109a commit da53655

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_codegen_llvm/src/consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl CodegenCx<'ll, 'tcx> {
210210

211211
debug!("get_static: sym={} instance={:?} fn_attrs={:?}", sym, instance, fn_attrs);
212212

213-
let g = if def_id.as_local().is_some() && !self.tcx.is_foreign_item(def_id) {
213+
let g = if def_id.is_local() && !self.tcx.is_foreign_item(def_id) {
214214
let llty = self.layout_of(ty).llvm_type(self);
215215
if let Some(g) = self.get_declared_value(sym) {
216216
if self.val_ty(g) != self.type_ptr_to(llty) {
@@ -241,7 +241,7 @@ impl CodegenCx<'ll, 'tcx> {
241241
llvm::set_thread_local_mode(g, self.tls_model);
242242
}
243243

244-
if def_id.as_local().is_none() {
244+
if !def_id.is_local() {
245245
let needs_dll_storage_attr = self.use_dll_storage_attrs && !self.tcx.is_foreign_item(def_id) &&
246246
// ThinLTO can't handle this workaround in all cases, so we don't
247247
// emit the attrs. Instead we make them unnecessary by disallowing

0 commit comments

Comments
 (0)