Rust fmt fixes
This commit is contained in:
@@ -215,7 +215,11 @@ impl Backend for FaerieBackend {
|
|||||||
} = data_ctx.description();
|
} = data_ctx.description();
|
||||||
|
|
||||||
if let Some((segment, section)) = custom_segment_section {
|
if let Some((segment, section)) = custom_segment_section {
|
||||||
return Err(cranelift_module::ModuleError::Backend(anyhow::anyhow!("Custom section not supported by cranelift-faerie: `{}:{}`", segment, section)));
|
return Err(cranelift_module::ModuleError::Backend(anyhow::anyhow!(
|
||||||
|
"Custom section not supported by cranelift-faerie: `{}:{}`",
|
||||||
|
segment,
|
||||||
|
section
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
for &(offset, id) in function_relocs {
|
for &(offset, id) in function_relocs {
|
||||||
|
|||||||
@@ -97,10 +97,7 @@ impl DataContext {
|
|||||||
|
|
||||||
/// Override the segment/section for data, only supported on Object backend
|
/// Override the segment/section for data, only supported on Object backend
|
||||||
pub fn set_segment_section(&mut self, seg: &str, sec: &str) {
|
pub fn set_segment_section(&mut self, seg: &str, sec: &str) {
|
||||||
self.description.custom_segment_section = Some((
|
self.description.custom_segment_section = Some((seg.to_owned(), sec.to_owned()))
|
||||||
seg.to_owned(),
|
|
||||||
sec.to_owned(),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Declare an external function import.
|
/// Declare an external function import.
|
||||||
|
|||||||
@@ -284,7 +284,9 @@ impl Backend for ObjectBackend {
|
|||||||
self.object.section_id(section_kind)
|
self.object.section_id(section_kind)
|
||||||
} else {
|
} else {
|
||||||
if tls {
|
if tls {
|
||||||
return Err(cranelift_module::ModuleError::Backend(anyhow::anyhow!("Custom section not supported for TLS")));
|
return Err(cranelift_module::ModuleError::Backend(anyhow::anyhow!(
|
||||||
|
"Custom section not supported for TLS"
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
let (seg, sec) = &custom_segment_section.as_ref().unwrap();
|
let (seg, sec) = &custom_segment_section.as_ref().unwrap();
|
||||||
self.object.add_section(
|
self.object.add_section(
|
||||||
|
|||||||
Reference in New Issue
Block a user