diff options
| author | SNCPlay42 <SNCPlay42@gmail.com> | 2020-10-19 17:58:44 +0100 |
|---|---|---|
| committer | SNCPlay42 <SNCPlay42@gmail.com> | 2020-10-19 21:11:40 +0100 |
| commit | c146e8c54fa0b99defd1ba77ad4d6505c491f4f3 (patch) | |
| tree | e6116aed29fde0b0173fda5563b25ce254db5628 /compiler/rustc_infer/src | |
| parent | 71ca239f8019755eb67a255fbf73450bae8ad4c2 (diff) | |
| download | rust-c146e8c54fa0b99defd1ba77ad4d6505c491f4f3.tar.gz rust-c146e8c54fa0b99defd1ba77ad4d6505c491f4f3.zip | |
revert workaround #73027
Diffstat (limited to 'compiler/rustc_infer/src')
| -rw-r--r-- | compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs index 2f3089f1a92..21023a06bb2 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs @@ -91,17 +91,6 @@ impl<'a, 'tcx> Visitor<'tcx> for FindHirNodeVisitor<'a, 'tcx> { if let (None, Some(ty)) = (self.found_local_pattern, self.node_ty_contains_target(local.hir_id)) { - // FIXME: There's a trade-off here - we can either check that our target span - // is contained in `local.span` or not. If we choose to check containment - // we can avoid some spurious suggestions (see #72690), but we lose - // the ability to report on things like: - // - // ``` - // let x = vec![]; - // ``` - // - // because the target span will be in the macro expansion of `vec![]`. - // At present we choose not to check containment. self.found_local_pattern = Some(&*local.pat); self.found_node_ty = Some(ty); } @@ -113,10 +102,8 @@ impl<'a, 'tcx> Visitor<'tcx> for FindHirNodeVisitor<'a, 'tcx> { if let (None, Some(ty)) = (self.found_arg_pattern, self.node_ty_contains_target(param.hir_id)) { - if self.target_span.contains(param.pat.span) { - self.found_arg_pattern = Some(&*param.pat); - self.found_node_ty = Some(ty); - } + self.found_arg_pattern = Some(&*param.pat); + self.found_node_ty = Some(ty); } } intravisit::walk_body(self, body); |
