) -> String {
let fn_sig = self.tcx.hir().get_if_local(self.def_id).and_then(hir::Node::fn_sig);
let is_used_in_input = |def_id| {
- fn_sig.map_or(false, |fn_sig| {
+ fn_sig.is_some_and(|fn_sig| {
fn_sig.decl.inputs.iter().any(|ty| match ty.kind {
hir::TyKind::Path(hir::QPath::Resolved(
None,
let span = self.path_segment.ident.span;
let msg = self.create_error_message();
- self.tcx.sess.struct_span_err_with_code(span, &msg, self.code())
+ self.tcx.sess.struct_span_err_with_code(span, msg, self.code())
}
/// Builds the `expected 1 type argument / supplied 2 type arguments` message.
err.span_suggestion_verbose(
span.shrink_to_hi(),
- &msg,
+ msg,
sugg,
Applicability::HasPlaceholders,
);
let sugg = format!("{}{}{}", sugg_prefix, suggested_args, sugg_suffix);
debug!("sugg: {:?}", sugg);
- err.span_suggestion_verbose(sugg_span, &msg, sugg, Applicability::HasPlaceholders);
+ err.span_suggestion_verbose(sugg_span, msg, sugg, Applicability::HasPlaceholders);
}
AngleBrackets::Implied => {
// We never encounter missing lifetimes in situations in which lifetimes are elided
err.span_suggestion_verbose(
span.shrink_to_hi(),
- &msg,
+ msg,
sugg,
Applicability::HasPlaceholders,
);
let sugg = format!("{}{}{}", sugg_prefix, suggested_args, sugg_suffix);
debug!("sugg: {:?}", sugg);
- err.span_suggestion_verbose(sugg_span, &msg, sugg, Applicability::HasPlaceholders);
+ err.span_suggestion_verbose(sugg_span, msg, sugg, Applicability::HasPlaceholders);
}
}
}
err.span_suggestion(
span_redundant_lt_args,
- &msg_lifetimes,
+ msg_lifetimes,
"",
Applicability::MaybeIncorrect,
);
err.span_suggestion(
span_redundant_type_or_const_args,
- &msg_types_or_consts,
+ msg_types_or_consts,
"",
Applicability::MaybeIncorrect,
);
if !suggestions.is_empty() {
err.multipart_suggestion_verbose(
- &format!(
+ format!(
"replace the generic bound{s} with the associated type{s}",
s = pluralize!(unbound_types.len())
),
},
);
- err.span_suggestion(span, &msg, "", Applicability::MaybeIncorrect);
+ err.span_suggestion(span, msg, "", Applicability::MaybeIncorrect);
} else if redundant_lifetime_args && redundant_type_or_const_args {
remove_lifetime_args(err);
remove_type_or_const_args(err);
)
};
- err.span_note(spans, &msg);
+ err.span_note(spans, msg);
}
/// Add note if `impl Trait` is explicitly specified.