From f5cc7dba8a32c1f83f3b3102f398405dc540841f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 18 Oct 2018 14:26:45 -0400 Subject: [PATCH] even though we don't need it yet, fix the "fast path" code --- src/librustc_typeck/check/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index ff92104d127f..ffa21e1fc22a 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -2361,9 +2361,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let ty = self.to_ty(ast_ty); // If the type given by the user has free regions, save it for - // later, since NLL would like to enforce those. Other sorts - // of things are already sufficiently enforced. =) - if ty.has_free_regions() { + // later, since NLL would like to enforce those. Also pass in + // types that involve projections, since those can resolve to + // `'static` bounds (modulo #54940, which hopefully will be + // fixed by the time you see this comment, dear reader, + // although I have my doubts). Other sorts of things are + // already sufficiently enforced with erased regions. =) + if ty.has_free_regions() || ty.has_projections() { let c_ty = self.infcx.canonicalize_response(&ty); self.tables.borrow_mut().user_provided_tys_mut().insert(ast_ty.hir_id, c_ty); }