diff options
| author | b-naber <bn263@gmx.de> | 2022-12-09 18:08:56 +0100 |
|---|---|---|
| committer | b-naber <bn263@gmx.de> | 2022-12-14 21:32:42 +0100 |
| commit | ff41359e6535ca7dc1261f282b1601136fedee21 (patch) | |
| tree | 4195ccf6503da1121ad55714ae600ecc879aa878 /compiler/rustc_middle/src | |
| parent | dc93a28e98e6bdcb73441ec699f43aa01d10e4e6 (diff) | |
| download | rust-ff41359e6535ca7dc1261f282b1601136fedee21.tar.gz rust-ff41359e6535ca7dc1261f282b1601136fedee21.zip | |
address review
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/mir/syntax.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs index 004dd004c72..b7a5f9c8757 100644 --- a/compiler/rustc_middle/src/mir/syntax.rs +++ b/compiler/rustc_middle/src/mir/syntax.rs @@ -875,6 +875,13 @@ pub struct Place<'tcx> { pub projection: &'tcx List<PlaceElem<'tcx>>, } +/// The different kinds of projections that can be used in the projection of a `Place`. +/// +/// `T1` is the generic type for a field projection. For an actual projection on a `Place` +/// this parameter will always be `Ty`, but the field type can be unavailable when +/// building (by using `PlaceBuilder`) places that correspond to upvars. +/// `T2` is the generic type for an `OpaqueCast` (is generic since it's abstracted over +/// in dataflow analysis, see `AbstractElem`). #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)] pub enum ProjectionElem<V, T1, T2> { @@ -942,7 +949,7 @@ pub enum ProjectionElem<V, T1, T2> { /// and the index is a local. pub type PlaceElem<'tcx> = ProjectionElem<Local, Ty<'tcx>, Ty<'tcx>>; -/// Alias for projections that appear in `PlaceBuilder::UpVar`, for which +/// Alias for projections that appear in `PlaceBuilder::Upvar`, for which /// we cannot provide any field types. pub type UpvarProjectionElem<'tcx> = ProjectionElem<Local, (), Ty<'tcx>>; |
