rustc: expose the mir::Body reference lifetime from mir::ReadOnlyBodyCache (#64736 fallout).

This commit is contained in:
Eduard-Mihai Burtescu 2019-12-03 12:55:58 +02:00
parent 4810cf1d1b
commit a57aea88d4
16 changed files with 62 additions and 70 deletions

View file

@ -279,18 +279,10 @@ impl<'a, 'b, 'tcx> graph::GraphSuccessors<'b> for ReadOnlyBodyCache<'a, 'tcx> {
impl Deref for ReadOnlyBodyCache<'a, 'tcx> {
type Target = Body<'tcx>;
type Target = &'a Body<'tcx>;
fn deref(&self) -> &Self::Target {
self.body
}
}
impl Index<BasicBlock> for ReadOnlyBodyCache<'a, 'tcx> {
type Output = BasicBlockData<'tcx>;
fn index(&self, index: BasicBlock) -> &BasicBlockData<'tcx> {
&self.body[index]
&self.body
}
}