Address more review comments
- Add back various diagnostic methods on `Session`. It seems unfortunate to duplicate these in so many places, but in the meantime, making the API inconsistent between `Session` and `Diagnostic` also seems unfortunate. - Add back TyCtxtAt methods These will hopefully be used in the near future. - Add back `with_const`, it would need to be added soon after anyway. - Add back `split()` and `get_mut()`, they're useful.
This commit is contained in:
parent
230e396a76
commit
f3523544f1
5 changed files with 81 additions and 1 deletions
|
@ -71,6 +71,11 @@ pub trait AllocMap<K: Hash + Eq, V> {
|
|||
fn get(&self, k: K) -> Option<&V> {
|
||||
self.get_or(k, || Err(())).ok()
|
||||
}
|
||||
|
||||
/// Mutable lookup.
|
||||
fn get_mut(&mut self, k: K) -> Option<&mut V> {
|
||||
self.get_mut_or(k, || Err(())).ok()
|
||||
}
|
||||
}
|
||||
|
||||
/// Methods of this trait signifies a point where CTFE evaluation would fail
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue