1
Fork 0

More general captures

This avoids repetition
This commit is contained in:
est31 2023-03-22 15:38:55 +01:00
parent febd59e122
commit edd7d4a9f7
3 changed files with 3 additions and 3 deletions

View file

@ -703,7 +703,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
PathResult::NonModule(path_res) if let Some(res) = path_res.full_res() => {
check_consistency(self, &path, path_span, kind, initial_res, res)
}
path_res @ PathResult::NonModule(..) | path_res @ PathResult::Failed { .. } => {
path_res @ (PathResult::NonModule(..) | PathResult::Failed { .. }) => {
let mut suggestion = None;
let (span, label) = if let PathResult::Failed { span, label, .. } = path_res {
// try to suggest if it's not a macro, maybe a function