From 7353ef744e1ff4e8b511f77969eab316e8e06f5b Mon Sep 17 00:00:00 2001 From: "leonardo.yvens" Date: Sun, 18 Feb 2018 10:39:26 -0300 Subject: [PATCH] Replace `structurally_resolve_type` in unary expr check. `resolve_type_vars_with_obligations` is the same but doesn't error on unresolved type variables. In theory this could make more code compile because we don't error or could ommit an otherwise useful error. In practice I couldn't observe any effect. --- src/librustc_typeck/check/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 69879bbe85d6e..e5d3e84e840d2 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -3639,7 +3639,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { needs); if !oprnd_t.references_error() { - oprnd_t = self.structurally_resolved_type(expr.span, oprnd_t); + oprnd_t = self.resolve_type_vars_with_obligations(&oprnd_t); match unop { hir::UnDeref => { if let Some(mt) = oprnd_t.builtin_deref(true) {