Rollup merge of #93363 - lcnr:pass-by-value, r=petrochenkov
`#[rustc_pass_by_value]` cleanup
This commit is contained in:
commit
8347f7851a
10 changed files with 35 additions and 26 deletions
|
@ -336,5 +336,5 @@ fn is_arg_inside_call(arg: Span, call: Span) -> bool {
|
|||
// panic call in the source file, to avoid invalid suggestions when macros are involved.
|
||||
// We specifically check for the spans to not be identical, as that happens sometimes when
|
||||
// proc_macros lie about spans and apply the same span to all the tokens they produce.
|
||||
call.contains(arg) && !call.source_equal(&arg)
|
||||
call.contains(arg) && !call.source_equal(arg)
|
||||
}
|
||||
|
|
|
@ -76,10 +76,10 @@ fn gen_args(cx: &LateContext<'_>, segment: &PathSegment<'_>) -> String {
|
|||
.map(|arg| match arg {
|
||||
GenericArg::Lifetime(lt) => lt.name.ident().to_string(),
|
||||
GenericArg::Type(ty) => {
|
||||
cx.tcx.sess.source_map().span_to_snippet(ty.span).unwrap_or_default()
|
||||
cx.tcx.sess.source_map().span_to_snippet(ty.span).unwrap_or_else(|_| "_".into())
|
||||
}
|
||||
GenericArg::Const(c) => {
|
||||
cx.tcx.sess.source_map().span_to_snippet(c.span).unwrap_or_default()
|
||||
cx.tcx.sess.source_map().span_to_snippet(c.span).unwrap_or_else(|_| "_".into())
|
||||
}
|
||||
GenericArg::Infer(_) => String::from("_"),
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue