Push AllowTwoPhase down to the HAIR level
For consistency, use AllowTwoPhase everywhere between the frontend and MIR.
This commit is contained in:
parent
96ae0ee382
commit
d64bd2afc3
8 changed files with 27 additions and 22 deletions
|
|
@ -188,6 +188,10 @@ for ty::adjustment::Adjust<'gcx> {
|
|||
impl_stable_hash_for!(struct ty::adjustment::Adjustment<'tcx> { kind, target });
|
||||
impl_stable_hash_for!(struct ty::adjustment::OverloadedDeref<'tcx> { region, mutbl });
|
||||
impl_stable_hash_for!(struct ty::UpvarBorrow<'tcx> { kind, region });
|
||||
impl_stable_hash_for!(enum ty::adjustment::AllowTwoPhase {
|
||||
Yes,
|
||||
No
|
||||
});
|
||||
|
||||
impl<'gcx> HashStable<StableHashingContext<'gcx>> for ty::adjustment::AutoBorrowMutability {
|
||||
fn hash_stable<W: StableHasherResult>(&self,
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ impl<'a, 'gcx, 'tcx> OverloadedDeref<'tcx> {
|
|||
/// new code via two-phase borrows, so we try to limit where we create two-phase
|
||||
/// capable mutable borrows.
|
||||
/// See #49434 for tracking.
|
||||
#[derive(Copy, Clone, PartialEq, Debug, RustcEncodable, RustcDecodable)]
|
||||
pub enum AllowTwoPhase {
|
||||
Yes,
|
||||
No
|
||||
|
|
@ -138,7 +139,7 @@ pub enum AllowTwoPhase {
|
|||
|
||||
#[derive(Copy, Clone, PartialEq, Debug, RustcEncodable, RustcDecodable)]
|
||||
pub enum AutoBorrowMutability {
|
||||
Mutable { allow_two_phase_borrow: bool },
|
||||
Mutable { allow_two_phase_borrow: AllowTwoPhase },
|
||||
Immutable,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue