Simplify some nested if statements
This commit is contained in:
@@ -186,17 +186,15 @@ fn maybe_check_static_with_link_section(tcx: TyCtxt<'_>, id: LocalDefId) {
|
||||
|
||||
if let Ok(alloc) = tcx.eval_static_initializer(id.to_def_id())
|
||||
&& alloc.inner().provenance().ptrs().len() != 0
|
||||
{
|
||||
if attrs
|
||||
&& attrs
|
||||
.link_section
|
||||
.map(|link_section| !link_section.as_str().starts_with(".init_array"))
|
||||
.unwrap()
|
||||
{
|
||||
let msg = "statics with a custom `#[link_section]` must be a \
|
||||
{
|
||||
let msg = "statics with a custom `#[link_section]` must be a \
|
||||
simple list of bytes on the wasm target with no \
|
||||
extra levels of indirection such as references";
|
||||
tcx.dcx().span_err(tcx.def_span(id), msg);
|
||||
}
|
||||
tcx.dcx().span_err(tcx.def_span(id), msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user