Skip to content

Commit

Permalink
codegen_llvm/misc: convert string literals with to_owned
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz committed Oct 9, 2018
1 parent b07a2d0 commit fa81576
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/librustc_codegen_llvm/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@ fn vec_slice_metadata(

let member_descriptions = vec![
MemberDescription {
name: "data_ptr".to_string(),
name: "data_ptr".to_owned(),
type_metadata: data_ptr_metadata,
offset: Size::ZERO,
size: pointer_size,
align: pointer_align,
flags: DIFlags::FlagZero,
},
MemberDescription {
name: "length".to_string(),
name: "length".to_owned(),
type_metadata: type_metadata(cx, cx.tcx.types.usize, span),
offset: pointer_size,
size: usize_size,
Expand Down Expand Up @@ -463,7 +463,7 @@ fn trait_pointer_metadata(
let vtable_field = layout.field(cx, 1);
let member_descriptions = vec![
MemberDescription {
name: "pointer".to_string(),
name: "pointer".to_owned(),
type_metadata: type_metadata(cx,
cx.tcx.mk_mut_ptr(cx.tcx.types.u8),
syntax_pos::DUMMY_SP),
Expand All @@ -473,7 +473,7 @@ fn trait_pointer_metadata(
flags: DIFlags::FlagArtificial,
},
MemberDescription {
name: "vtable".to_string(),
name: "vtable".to_owned(),
type_metadata: type_metadata(cx, vtable_field.ty, syntax_pos::DUMMY_SP),
offset: layout.fields.offset(1),
size: vtable_field.size,
Expand Down Expand Up @@ -1362,7 +1362,7 @@ fn describe_enum_variant(
// We have the layout of an enum variant, we need the layout of the outer enum
let enum_layout = cx.layout_of(layout.ty);
(Some(enum_layout.fields.offset(0)),
Some(("RUST$ENUM$DISR".to_string(), enum_layout.field(cx, 0).ty)))
Some(("RUST$ENUM$DISR".to_owned(), enum_layout.field(cx, 0).ty)))
}
_ => (None, None),
};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/llvm/archive_ro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl ArchiveRO {
return unsafe {
let s = path2cstr(dst);
let ar = super::LLVMRustOpenArchive(s.as_ptr()).ok_or_else(|| {
super::last_error().unwrap_or("failed to open archive".to_string())
super::last_error().unwrap_or("failed to open archive".to_owned())
})?;
Ok(ArchiveRO { raw: ar })
};
Expand Down

0 comments on commit fa81576

Please sign in to comment.