From 9a4f0abd7a385416acf9d93b9d77ea1fdf755f93 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sun, 12 May 2019 18:51:40 +0100 Subject: [PATCH] Don't allow any ReScope in impl trait types This shouldn't be possible any more, but if it does happen, emit an error rather than maybe panicking later when NLL finds a the ReScope. Impl trait in bindings is sufficiently broken that I don't think this breaks anything that works for it. --- src/librustc/infer/opaque_types/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/librustc/infer/opaque_types/mod.rs b/src/librustc/infer/opaque_types/mod.rs index a8dca9062bd2c..4351f94df2f13 100644 --- a/src/librustc/infer/opaque_types/mod.rs +++ b/src/librustc/infer/opaque_types/mod.rs @@ -611,10 +611,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for ReverseMapper<'cx, 'gcx, 'tcx> ty::ReLateBound(..) | // ignore `'static`, as that can appear anywhere - ty::ReStatic | - - // ignore `ReScope`, which may appear in impl Trait in bindings. - ty::ReScope(..) => return r, + ty::ReStatic => return r, _ => { } }