Struct rustc::infer::anon_types::AnonTypeDecl
[−]
[src]
pub struct AnonTypeDecl<'tcx> { pub substs: &'tcx Substs<'tcx>, pub concrete_ty: Ty<'tcx>, pub has_required_region_bounds: bool, }
🔬 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?
Information about the anonymous, abstract types whose values we
are inferring in this function (these are the impl Trait
that
appear in the return type).
Fields
substs: &'tcx Substs<'tcx>
🔬 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?
The substitutions that we apply to the abstract that that this
impl Trait
desugars to. e.g., if:
fn foo<'a, 'b, T>() -> impl Trait<'a>
winds up desugared to:
abstract type Foo<'x, T>: Trait<'x> fn foo<'a, 'b, T>() -> Foo<'a, T>
then substs
would be ['a, T]
.
concrete_ty: Ty<'tcx>
🔬 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?
The type variable that represents the value of the abstract type that we require. In other words, after we compile this function, we will be created a constraint like:
Foo<'a, T> = ?C
where ?C
is the value of this type variable. =) It may
naturally refer to the type and lifetime parameters in scope
in this function, though ultimately it should only reference
those that are arguments to Foo
in the constraint above. (In
other words, ?C
should not include 'b
, even though it's a
lifetime parameter on foo
.)
has_required_region_bounds: bool
🔬 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?
True if the impl Trait
bounds include region bounds.
For example, this would be true for:
fn foo<'a, 'b, 'c>() -> impl Trait<'c> + 'a + 'b
but false for:
fn foo<'c>() -> impl Trait<'c>
unless Trait
was declared like:
trait Trait<'c>: 'c
in which case it would be true.
This is used during regionck to decide whether we need to
impose any additional constraints to ensure that region
variables in concrete_ty
wind up being constrained to
something from substs
(or, at minimum, things that outlive
the fn body). (Ultimately, writeback is responsible for this
check.)
Trait Implementations
impl<'tcx> Copy for AnonTypeDecl<'tcx>
[src]
impl<'tcx> Copy for AnonTypeDecl<'tcx>
impl<'tcx> Clone for AnonTypeDecl<'tcx>
[src]
impl<'tcx> Clone for AnonTypeDecl<'tcx>
fn clone(&self) -> AnonTypeDecl<'tcx>
[src]
fn clone(&self) -> AnonTypeDecl<'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'tcx> Debug for AnonTypeDecl<'tcx>
[src]
impl<'tcx> Debug for AnonTypeDecl<'tcx>
Auto Trait Implementations
impl<'tcx> !Send for AnonTypeDecl<'tcx>
impl<'tcx> !Send for AnonTypeDecl<'tcx>
impl<'tcx> !Sync for AnonTypeDecl<'tcx>
impl<'tcx> !Sync for AnonTypeDecl<'tcx>