diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-04-15 20:18:30 +0200 | 
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2023-04-16 13:28:13 +0200 | 
| commit | 543f8bc38c78c05319b5774ec2337c6d3c9b434b (patch) | |
| tree | ff617ed6f58a0e2622730499574eceb7bbccf461 /compiler/rustc_resolve/src/diagnostics.rs | |
| parent | e6e956dade79bdc084dfe3078abab24656a1b483 (diff) | |
| download | rust-543f8bc38c78c05319b5774ec2337c6d3c9b434b.tar.gz rust-543f8bc38c78c05319b5774ec2337c6d3c9b434b.zip | |
fix clippy::toplevel_ref_arg and ::manual_map
Diffstat (limited to 'compiler/rustc_resolve/src/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/diagnostics.rs | 10 | 
1 files changed, 4 insertions, 6 deletions
| diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 0c9d306081e..4f8e966ff66 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -1867,15 +1867,13 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { Some(LexicalScopeBinding::Item(name_binding)) => Some(name_binding.span), _ => None, }; - let suggestion = if let Some(span) = match_span { - Some(( + let suggestion = match_span.map(|span| { + ( vec![(span, String::from(""))], format!("`{}` is defined here, but is not a type", ident), Applicability::MaybeIncorrect, - )) - } else { - None - }; + ) + }); (format!("use of undeclared type `{}`", ident), suggestion) } else { | 
