Auto merge of #144469 - Kivooeo:chains-cleanup, r=SparrowLii

Some `let chains` clean-up

Not sure if this kind of clean-up is welcoming because of size, but I decided to try out one

r? compiler
This commit is contained in:
bors
2025-07-28 05:25:23 +00:00
77 changed files with 1115 additions and 1209 deletions

View File

@@ -107,10 +107,10 @@ pub fn feature_err_issue(
let span = span.into();
// Cancel an earlier warning for this same error, if it exists.
if let Some(span) = span.primary_span() {
if let Some(err) = sess.dcx().steal_non_err(span, StashKey::EarlySyntaxWarning) {
err.cancel()
}
if let Some(span) = span.primary_span()
&& let Some(err) = sess.dcx().steal_non_err(span, StashKey::EarlySyntaxWarning)
{
err.cancel()
}
let mut err = sess.dcx().create_err(FeatureGateError { span, explain: explain.into() });

View File

@@ -1363,11 +1363,11 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
sess.dcx().emit_err(errors::InstrumentationNotSupported { us: "XRay".to_string() });
}
if let Some(flavor) = sess.opts.cg.linker_flavor {
if let Some(compatible_list) = sess.target.linker_flavor.check_compatibility(flavor) {
let flavor = flavor.desc();
sess.dcx().emit_err(errors::IncompatibleLinkerFlavor { flavor, compatible_list });
}
if let Some(flavor) = sess.opts.cg.linker_flavor
&& let Some(compatible_list) = sess.target.linker_flavor.check_compatibility(flavor)
{
let flavor = flavor.desc();
sess.dcx().emit_err(errors::IncompatibleLinkerFlavor { flavor, compatible_list });
}
if sess.opts.unstable_opts.function_return != FunctionReturn::default() {