Skip to content

Commit b50db34

Browse files
committed
Remove LocalInternedString uses from librustc_codegen_llvm/consts.rs.
1 parent 0ad111f commit b50db34

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/librustc_codegen_llvm/consts.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ use rustc::mir::interpret::{ConstValue, Allocation, read_target_uint,
1111
Pointer, ErrorHandled, GlobalId};
1212
use rustc::mir::mono::MonoItem;
1313
use rustc::hir::Node;
14-
use syntax_pos::Span;
1514
use rustc_target::abi::HasDataLayout;
16-
use syntax::symbol::sym;
17-
use syntax_pos::symbol::LocalInternedString;
1815
use rustc::ty::{self, Ty, Instance};
1916
use rustc_codegen_ssa::traits::*;
17+
use syntax::symbol::{Symbol, sym};
18+
use syntax_pos::Span;
2019

2120
use rustc::ty::layout::{self, Size, Align, LayoutOf};
2221

@@ -104,10 +103,11 @@ fn check_and_apply_linkage(
104103
cx: &CodegenCx<'ll, 'tcx>,
105104
attrs: &CodegenFnAttrs,
106105
ty: Ty<'tcx>,
107-
sym: LocalInternedString,
106+
sym: Symbol,
108107
span: Span
109108
) -> &'ll Value {
110109
let llty = cx.layout_of(ty).llvm_type(cx);
110+
let sym = sym.as_str();
111111
if let Some(linkage) = attrs.linkage {
112112
debug!("get_static: sym={} linkage={:?}", sym, linkage);
113113

@@ -203,7 +203,7 @@ impl CodegenCx<'ll, 'tcx> {
203203
def_id);
204204

205205
let ty = instance.ty(self.tcx);
206-
let sym = self.tcx.symbol_name(instance).name.as_str();
206+
let sym = self.tcx.symbol_name(instance).name.as_symbol();
207207

208208
debug!("get_static: sym={} instance={:?}", sym, instance);
209209

@@ -214,11 +214,12 @@ impl CodegenCx<'ll, 'tcx> {
214214
Node::Item(&hir::Item {
215215
ref attrs, span, node: hir::ItemKind::Static(..), ..
216216
}) => {
217-
if self.get_declared_value(&sym[..]).is_some() {
217+
let sym_str = sym.as_str();
218+
if self.get_declared_value(&sym_str).is_some() {
218219
span_bug!(span, "Conflicting symbol names for static?");
219220
}
220221

221-
let g = self.define_global(&sym[..], llty).unwrap();
222+
let g = self.define_global(&sym_str, llty).unwrap();
222223

223224
if !self.tcx.is_reachable_non_generic(def_id) {
224225
unsafe {

0 commit comments

Comments
 (0)