diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-10-18 14:26:45 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-10-19 09:34:28 -0400 |
| commit | f5cc7dba8a32c1f83f3b3102f398405dc540841f (patch) | |
| tree | 3da860ab0f19487d7660a848034500aede8bb381 | |
| parent | 16b3ea1e2e690524796b37a4b4e2f88e60a9dc3e (diff) | |
| download | rust-f5cc7dba8a32c1f83f3b3102f398405dc540841f.tar.gz rust-f5cc7dba8a32c1f83f3b3102f398405dc540841f.zip | |
even though we don't need it yet, fix the "fast path" code
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index ff92104d127..ffa21e1fc22 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); } |
