Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthewjasper committed May 12, 2019
1 parent 1f5145e commit 9a4f0ab
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/librustc/infer/opaque_types/mod.rs
Expand Up @@ -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,

_ => { }
}
Expand Down

0 comments on commit 9a4f0ab

Please sign in to comment.