Skip to content

Commit f5cc7db

Browse files
committed
even though we don't need it yet, fix the "fast path" code
1 parent 16b3ea1 commit f5cc7db

File tree

1 file changed

+7
-3
lines changed
  • src/librustc_typeck/check

1 file changed

+7
-3
lines changed

src/librustc_typeck/check/mod.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -2361,9 +2361,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
23612361
let ty = self.to_ty(ast_ty);
23622362

23632363
// If the type given by the user has free regions, save it for
2364-
// later, since NLL would like to enforce those. Other sorts
2365-
// of things are already sufficiently enforced. =)
2366-
if ty.has_free_regions() {
2364+
// later, since NLL would like to enforce those. Also pass in
2365+
// types that involve projections, since those can resolve to
2366+
// `'static` bounds (modulo #54940, which hopefully will be
2367+
// fixed by the time you see this comment, dear reader,
2368+
// although I have my doubts). Other sorts of things are
2369+
// already sufficiently enforced with erased regions. =)
2370+
if ty.has_free_regions() || ty.has_projections() {
23672371
let c_ty = self.infcx.canonicalize_response(&ty);
23682372
self.tables.borrow_mut().user_provided_tys_mut().insert(ast_ty.hir_id, c_ty);
23692373
}

0 commit comments

Comments
 (0)