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:
commit
ee08261c8c
93 changed files with 458 additions and 447 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue