Skip to content

Commit b009778

Browse files
librustc_trans has been updated
1 parent 1ff6e53 commit b009778

File tree

10 files changed

+63
-63
lines changed

10 files changed

+63
-63
lines changed

src/librustc_trans/back/link.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub fn find_crate_name(sess: Option<&Session>,
141141
if let Some(sess) = sess {
142142
if let Some(ref s) = sess.opts.crate_name {
143143
if let Some((attr, ref name)) = attr_crate_name {
144-
if *s != name.get() {
144+
if *s != &name[] {
145145
let msg = format!("--crate-name and #[crate_name] are \
146146
required to match, but `{}` != `{}`",
147147
s, name);
@@ -153,7 +153,7 @@ pub fn find_crate_name(sess: Option<&Session>,
153153
}
154154

155155
if let Some((attr, s)) = attr_crate_name {
156-
return validate(s.get().to_string(), Some(attr.span));
156+
return validate(s.to_string(), Some(attr.span));
157157
}
158158
if let Input::File(ref path) = *input {
159159
if let Some(s) = path.filestem_str() {
@@ -293,7 +293,7 @@ pub fn mangle<PI: Iterator<Item=PathElem>>(path: PI,
293293

294294
// First, connect each component with <len, name> pairs.
295295
for e in path {
296-
push(&mut n, &token::get_name(e.name()).get()[])
296+
push(&mut n, &token::get_name(e.name())[])
297297
}
298298

299299
match hash {

src/librustc_trans/save/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
355355
},
356356
};
357357

358-
let qualname = format!("{}::{}", qualname, get_ident(method.pe_ident()).get());
358+
let qualname = format!("{}::{}", qualname, &get_ident(method.pe_ident())[]);
359359
let qualname = &qualname[];
360360

361361
// record the decl for this def (if it has one)
@@ -436,7 +436,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
436436
Some(sub_span) => self.fmt.field_str(field.span,
437437
Some(sub_span),
438438
field.node.id,
439-
&name.get()[],
439+
&name[],
440440
&qualname[],
441441
&typ[],
442442
scope_id),
@@ -525,7 +525,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
525525
self.fmt.static_str(item.span,
526526
sub_span,
527527
item.id,
528-
get_ident(item.ident).get(),
528+
&get_ident(item.ident)[],
529529
&qualname[],
530530
&value[],
531531
&ty_to_string(&*typ)[],
@@ -548,7 +548,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
548548
self.fmt.static_str(item.span,
549549
sub_span,
550550
item.id,
551-
get_ident(item.ident).get(),
551+
&get_ident(item.ident)[],
552552
&qualname[],
553553
"",
554554
&ty_to_string(&*typ)[],
@@ -607,7 +607,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
607607
}
608608
for variant in &enum_definition.variants {
609609
let name = get_ident(variant.node.name);
610-
let name = name.get();
610+
let name = &name[];
611611
let mut qualname = enum_name.clone();
612612
qualname.push_str("::");
613613
qualname.push_str(name);
@@ -1094,7 +1094,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DxrVisitor<'l, 'tcx> {
10941094
sub_span,
10951095
item.id,
10961096
mod_id,
1097-
get_ident(ident).get(),
1097+
&get_ident(ident)[],
10981098
self.cur_scope);
10991099
self.write_sub_paths_truncated(path, true);
11001100
}
@@ -1149,9 +1149,9 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DxrVisitor<'l, 'tcx> {
11491149
}
11501150
ast::ItemExternCrate(ref s) => {
11511151
let name = get_ident(item.ident);
1152-
let name = name.get();
1152+
let name = &name[];
11531153
let location = match *s {
1154-
Some((ref s, _)) => s.get().to_string(),
1154+
Some((ref s, _)) => s.to_string(),
11551155
None => name.to_string(),
11561156
};
11571157
let alias_span = self.span.span_for_last_ident(item.span);
@@ -1259,7 +1259,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DxrVisitor<'l, 'tcx> {
12591259
},
12601260
};
12611261

1262-
qualname.push_str(get_ident(method_type.ident).get());
1262+
qualname.push_str(&get_ident(method_type.ident)[]);
12631263
let qualname = &qualname[];
12641264

12651265
let sub_span = self.span.sub_span_after_keyword(method_type.span, keywords::Fn);
@@ -1541,7 +1541,7 @@ pub fn process_crate(sess: &Session,
15411541

15421542
assert!(analysis.glob_map.is_some());
15431543
let cratename = match attr::find_crate_name(&krate.attrs[]) {
1544-
Some(name) => name.get().to_string(),
1544+
Some(name) => name.to_string(),
15451545
None => {
15461546
info!("Could not find crate name, using 'unknown_crate'");
15471547
String::from_str("unknown_crate")

src/librustc_trans/trans/asm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
7777
fcx.pop_custom_cleanup_scope(temp_scope);
7878

7979
let mut constraints = constraints.iter()
80-
.map(|s| s.get().to_string())
80+
.map(|s| s.to_string())
8181
.chain(ext_constraints.into_iter())
8282
.collect::<Vec<String>>()
8383
.connect(",");
8484

8585
let mut clobbers = ia.clobbers.iter()
86-
.map(|s| format!("~{{{}}}", s.get()))
86+
.map(|s| format!("~{{{}}}", &s[]))
8787
.collect::<Vec<String>>()
8888
.connect(",");
8989
let more_clobbers = get_clobbers();
@@ -120,7 +120,7 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
120120
ast::AsmIntel => llvm::AD_Intel
121121
};
122122

123-
let asm = CString::from_slice(ia.asm.get().as_bytes());
123+
let asm = CString::from_slice(ia.asm.as_bytes());
124124
let constraints = CString::from_slice(constraints.as_bytes());
125125
let r = InlineAsmCall(bcx,
126126
asm.as_ptr(),

src/librustc_trans/trans/base.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ pub fn set_llvm_fn_attrs(ccx: &CrateContext, attrs: &[ast::Attribute], llfn: Val
444444

445445
for attr in attrs {
446446
let mut used = true;
447-
match attr.name().get() {
447+
match &attr.name()[] {
448448
"no_stack_check" => unset_split_stack(llfn),
449449
"no_split_stack" => {
450450
unset_split_stack(llfn);
@@ -2248,7 +2248,7 @@ pub fn update_linkage(ccx: &CrateContext,
22482248
let item = ccx.tcx().map.get(id);
22492249
if let ast_map::NodeItem(i) = item {
22502250
if let Some(name) = attr::first_attr_value_str_by_name(&i.attrs, "linkage") {
2251-
if let Some(linkage) = llvm_linkage_by_name(name.get()) {
2251+
if let Some(linkage) = llvm_linkage_by_name(&name[]) {
22522252
llvm::SetLinkage(llval, linkage);
22532253
} else {
22542254
ccx.sess().span_fatal(i.span, "invalid linkage specified");
@@ -2721,15 +2721,15 @@ fn exported_name<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, id: ast::NodeId,
27212721

27222722
match attr::first_attr_value_str_by_name(attrs, "export_name") {
27232723
// Use provided name
2724-
Some(name) => name.get().to_string(),
2724+
Some(name) => name.to_string(),
27252725

27262726
_ => ccx.tcx().map.with_path(id, |path| {
27272727
if attr::contains_name(attrs, "no_mangle") {
27282728
// Don't mangle
27292729
path.last().unwrap().to_string()
27302730
} else {
27312731
match weak_lang_items::link_name(attrs) {
2732-
Some(name) => name.get().to_string(),
2732+
Some(name) => name.to_string(),
27332733
None => {
27342734
// Usual name mangling
27352735
mangle_exported_name(ccx, path, ty, id)
@@ -2824,12 +2824,12 @@ pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
28242824
match attr::first_attr_value_str_by_name(&i.attrs[],
28252825
"link_section") {
28262826
Some(sect) => {
2827-
if contains_null(sect.get()) {
2827+
if contains_null(&sect[]) {
28282828
ccx.sess().fatal(&format!("Illegal null byte in link_section value: `{}`",
2829-
sect.get())[]);
2829+
&sect[])[]);
28302830
}
28312831
unsafe {
2832-
let buf = CString::from_slice(sect.get().as_bytes());
2832+
let buf = CString::from_slice(sect.as_bytes());
28332833
llvm::LLVMSetSection(v, buf.as_ptr());
28342834
}
28352835
},
@@ -2869,7 +2869,7 @@ pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
28692869
let abi = ccx.tcx().map.get_foreign_abi(id);
28702870
let ty = ty::node_id_to_type(ccx.tcx(), ni.id);
28712871
let name = foreign::link_name(&*ni);
2872-
foreign::register_foreign_item_fn(ccx, abi, ty, &name.get()[])
2872+
foreign::register_foreign_item_fn(ccx, abi, ty, &name[])
28732873
}
28742874
ast::ForeignItemStatic(..) => {
28752875
foreign::register_static(ccx, &*ni)

src/librustc_trans/trans/common.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ impl<'blk, 'tcx> BlockS<'blk, 'tcx> {
590590
pub fn sess(&self) -> &'blk Session { self.fcx.ccx.sess() }
591591

592592
pub fn ident(&self, ident: Ident) -> String {
593-
token::get_ident(ident).get().to_string()
593+
token::get_ident(ident).to_string()
594594
}
595595

596596
pub fn node_id_to_string(&self, id: ast::NodeId) -> String {
@@ -834,8 +834,8 @@ pub fn C_cstr(cx: &CrateContext, s: InternedString, null_terminated: bool) -> Va
834834
}
835835

836836
let sc = llvm::LLVMConstStringInContext(cx.llcx(),
837-
s.get().as_ptr() as *const c_char,
838-
s.get().len() as c_uint,
837+
s.as_ptr() as *const c_char,
838+
s.len() as c_uint,
839839
!null_terminated as Bool);
840840

841841
let gsym = token::gensym("str");
@@ -853,7 +853,7 @@ pub fn C_cstr(cx: &CrateContext, s: InternedString, null_terminated: bool) -> Va
853853
// NB: Do not use `do_spill_noroot` to make this into a constant string, or
854854
// you will be kicked off fast isel. See issue #4352 for an example of this.
855855
pub fn C_str_slice(cx: &CrateContext, s: InternedString) -> ValueRef {
856-
let len = s.get().len();
856+
let len = s.len();
857857
let cs = consts::ptrcast(C_cstr(cx, s, false), Type::i8p(cx));
858858
C_named_struct(cx.tn().find_type("str_slice").unwrap(), &[cs, C_uint(cx, len)])
859859
}

src/librustc_trans/trans/consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ pub fn const_lit(cx: &CrateContext, e: &ast::Expr, lit: &ast::Lit)
5858
}
5959
}
6060
ast::LitFloat(ref fs, t) => {
61-
C_floating(fs.get(), Type::float_from_ty(cx, t))
61+
C_floating(&fs[], Type::float_from_ty(cx, t))
6262
}
6363
ast::LitFloatUnsuffixed(ref fs) => {
6464
let lit_float_ty = ty::node_id_to_type(cx.tcx(), e.id);
6565
match lit_float_ty.sty {
6666
ty::ty_float(t) => {
67-
C_floating(fs.get(), Type::float_from_ty(cx, t))
67+
C_floating(&fs[], Type::float_from_ty(cx, t))
6868
}
6969
_ => {
7070
cx.sess().span_bug(lit.span,

0 commit comments

Comments
 (0)