diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-08-22 22:29:25 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-09-13 19:18:24 +0200 |
| commit | af128b0144aa64bce28ca8d85a27fdaa9c5f47d7 (patch) | |
| tree | fb29bda2cccfa339c260a7a77f03125d157f8254 /compiler/rustc_middle | |
| parent | 445841cda32cf9fb95528cfe8d126d0a0e0cb608 (diff) | |
| download | rust-af128b0144aa64bce28ca8d85a27fdaa9c5f47d7.tar.gz rust-af128b0144aa64bce28ca8d85a27fdaa9c5f47d7.zip | |
Also compute implicit params in THIR.
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/thir.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs index 0214610f687..165b9103968 100644 --- a/compiler/rustc_middle/src/thir.rs +++ b/compiler/rustc_middle/src/thir.rs @@ -73,6 +73,8 @@ macro_rules! thir_with_elements { } } +pub const UPVAR_ENV_PARAM: ParamId = ParamId::from_u32(0); + thir_with_elements! { arms: ArmId => Arm<'tcx> => "a{}", blocks: BlockId => Block => "b{}", @@ -84,8 +86,8 @@ thir_with_elements! { /// Description of a type-checked function parameter. #[derive(Clone, Debug, HashStable)] pub struct Param<'tcx> { - /// The pattern that appears in the parameter list. - pub pat: Box<Pat<'tcx>>, + /// The pattern that appears in the parameter list, or None for implicit parameters. + pub pat: Option<Box<Pat<'tcx>>>, /// The possibly inferred type. pub ty: Ty<'tcx>, /// Span of the explicitly provided type, or None if inferred for closures. @@ -93,7 +95,7 @@ pub struct Param<'tcx> { /// Whether this param is `self`, and how it is bound. pub self_kind: Option<hir::ImplicitSelfKind>, /// HirId for lints. - pub hir_id: hir::HirId, + pub hir_id: Option<hir::HirId>, } #[derive(Copy, Clone, Debug, HashStable)] |
