Enum rustc::ty::adjustment::AllowTwoPhase[][src]

pub enum AllowTwoPhase {
    Yes,
    No,
}
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

At least for initial deployment, we want to limit two-phase borrows to only a few specific cases. Right now, those mostly "things that desugar" into method calls - using x.some_method() syntax, where some_method takes &mut self - using Foo::some_method(&mut x, ...) syntax - binary assignment operators (+=, -=, *=, etc.) Anything else should be rejected until generalized two phase borrow support is implemented. Right now, dataflow can't handle the general case where there is more than one use of a mutable borrow, and we don't want to accept too much new code via two-phase borrows, so we try to limit where we create two-phase capable mutable borrows. See #49434 for tracking.

Variants

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Trait Implementations

impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for AllowTwoPhase
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

impl Copy for AllowTwoPhase
[src]

impl Clone for AllowTwoPhase
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for AllowTwoPhase
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for AllowTwoPhase
[src]

Formats the value using the given formatter. Read more

impl Encodable for AllowTwoPhase
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

impl Decodable for AllowTwoPhase
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Auto Trait Implementations

impl Send for AllowTwoPhase

impl Sync for AllowTwoPhase