mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Update ProjectionElem::Downcast
documentation
`ProjectionElem:::Downcast` is used when downcasting to a variant of an enum or a generator, regardless of the number of variants.
This commit is contained in:
parent
086bf7a8ff
commit
a63d414031
@ -2017,9 +2017,7 @@ pub enum ProjectionElem<V, T> {
|
|||||||
from_end: bool,
|
from_end: bool,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// "Downcast" to a variant of an ADT. Currently, we only introduce
|
/// "Downcast" to a variant of an enum or a generator.
|
||||||
/// this for ADTs with more than one variant. It may be better to
|
|
||||||
/// just introduce it always, or always for enums.
|
|
||||||
///
|
///
|
||||||
/// The included Symbol is the name of the variant, used for printing MIR.
|
/// The included Symbol is the name of the variant, used for printing MIR.
|
||||||
Downcast(Option<Symbol>, VariantIdx),
|
Downcast(Option<Symbol>, VariantIdx),
|
||||||
|
@ -12,7 +12,7 @@ use rustc_target::abi::VariantIdx;
|
|||||||
#[derive(Copy, Clone, Debug, TypeFoldable)]
|
#[derive(Copy, Clone, Debug, TypeFoldable)]
|
||||||
pub struct PlaceTy<'tcx> {
|
pub struct PlaceTy<'tcx> {
|
||||||
pub ty: Ty<'tcx>,
|
pub ty: Ty<'tcx>,
|
||||||
/// Downcast to a particular variant of an enum, if included.
|
/// Downcast to a particular variant of an enum or a generator, if included.
|
||||||
pub variant_index: Option<VariantIdx>,
|
pub variant_index: Option<VariantIdx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user