Rollup merge of #60928 - TheSirC:fix/60229, r=eddyb

Changes the type `mir::Mir` into `mir::Body`

Fixes part 1 of #60229 (previously attempted in #60242).

I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date.

The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.
This commit is contained in:
Mazdak Farrokhzad 2019-05-29 00:19:55 +02:00 committed by GitHub
commit ee08261c8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
93 changed files with 458 additions and 447 deletions

View file

@ -11,16 +11,16 @@
use std::rc::Rc;
#[derive(Clone)]
enum CachedMir<'mir> {
enum Cached<'mir> {
Ref(&'mir String),
Owned(Rc<String>),
}
impl<'mir> CachedMir<'mir> {
impl<'mir> Cached<'mir> {
fn get_ref<'a>(&'a self) -> &'a String {
match *self {
CachedMir::Ref(r) => r,
CachedMir::Owned(ref rc) => &rc,
Cached::Ref(r) => r,
Cached::Owned(ref rc) => &rc,
}
}
}