The cached C3 linearization of `cls`, or `[cls]` when uncached (native classes, or an inconsistent hierarchy that `c3_merge` declined to cache).
(&self, c: Val)
| 30 | impl<'a> VM<'a> { |
| 31 | // The cached C3 linearization of `cls`, or `[cls]` when uncached (native classes, or an inconsistent hierarchy that `c3_merge` declined to cache). |
| 32 | fn mro_of(&self, c: Val) -> alloc::vec::Vec<Val> { |
| 33 | match self.mro_cache.get(&c.0) { |
| 34 | Some(r) => (**r).clone(), |
| 35 | None => alloc::vec![c], |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | /* C3 merge of the bases' linearizations plus the bases list itself, the tail of `L[cls] = cls :: merge(...)`. `cls` is prepended by the caller (it isn't allocated yet at validation time). Errs on an inconsistent hierarchy, matching CPython's `TypeError` at class creation. */ |
| 40 | pub(crate) fn c3_merge(&self, bases: &[Val]) -> Result<alloc::vec::Vec<Val>, VmErr> { |