Skip to content

Commit fb1b198

Browse files
authored
Rollup merge of rust-lang#122799 - estebank:issue-122569, r=fee1-dead
Replace closures with `_` when suggesting fully qualified path for method call ``` error[E0283]: type annotations needed --> $DIR/into-inference-needs-type.rs:12:10 | LL | .into()?; | ^^^^ | = note: cannot satisfy `_: From<...>` = note: required for `FilterMap<...>` to implement `Into<_>` help: try using a fully qualified path to specify the expected types | LL ~ let list = <FilterMap<Map<std::slice::Iter<'_, &str>, _>, _> as Into<T>>::into(vec LL | .iter() LL | .map(|s| s.strip_prefix("t")) LL ~ .filter_map(Option::Some))?; | ``` Fix rust-lang#122569.
2 parents e8794ff + 9022122 commit fb1b198

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_lints/src/box_default.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ impl LateLintPass<'_> for BoxDefault {
7070
"try",
7171
if is_plain_default(cx, arg_path) || given_type(cx, expr) {
7272
"Box::default()".into()
73-
} else if let Some(arg_ty) = cx.typeck_results().expr_ty(arg).make_suggestable(cx.tcx, true) {
73+
} else if let Some(arg_ty) =
74+
cx.typeck_results().expr_ty(arg).make_suggestable(cx.tcx, true, None)
75+
{
7476
// Check if we can copy from the source expression in the replacement.
7577
// We need the call to have no argument (see `explicit_default_type`).
7678
if inner_call_args.is_empty()

0 commit comments

Comments
 (0)