Skip to content

Commit 9a4f0ab

Browse files
committed
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.
1 parent 1f5145e commit 9a4f0ab

File tree

1 file changed

+1
-4
lines changed
  • src/librustc/infer/opaque_types

1 file changed

+1
-4
lines changed

Diff for: src/librustc/infer/opaque_types/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for ReverseMapper<'cx, 'gcx, 'tcx>
611611
ty::ReLateBound(..) |
612612

613613
// ignore `'static`, as that can appear anywhere
614-
ty::ReStatic |
615-
616-
// ignore `ReScope`, which may appear in impl Trait in bindings.
617-
ty::ReScope(..) => return r,
614+
ty::ReStatic => return r,
618615

619616
_ => { }
620617
}

0 commit comments

Comments
 (0)