X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Fhair%2Fpattern%2Fmod.rs;h=4b6be426e5178c0ffb8d62caab55d872dbeede16;hb=fff08cb04389497d254fb40948674cbbee402908;hp=716838b4fc597c4078641bd013371122d13c098a;hpb=31d7aa48b4c2919d3b2ee65780ebbb57eeff2732;p=rust.git diff --git a/src/librustc_mir/hair/pattern/mod.rs b/src/librustc_mir/hair/pattern/mod.rs index 716838b4fc5..4b6be426e51 100644 --- a/src/librustc_mir/hair/pattern/mod.rs +++ b/src/librustc_mir/hair/pattern/mod.rs @@ -327,7 +327,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } pub struct PatternContext<'a, 'tcx: 'a> { - pub tcx: TyCtxt<'a, 'tcx, 'tcx>, + pub tcx: TyCtxt<'tcx, 'tcx>, pub param_env: ty::ParamEnv<'tcx>, pub tables: &'a ty::TypeckTables<'tcx>, pub substs: SubstsRef<'tcx>, @@ -335,10 +335,12 @@ pub struct PatternContext<'a, 'tcx: 'a> { } impl<'a, 'tcx> Pattern<'tcx> { - pub fn from_hir(tcx: TyCtxt<'a, 'tcx, 'tcx>, - param_env_and_substs: ty::ParamEnvAnd<'tcx, SubstsRef<'tcx>>, - tables: &'a ty::TypeckTables<'tcx>, - pat: &'tcx hir::Pat) -> Self { + pub fn from_hir( + tcx: TyCtxt<'tcx, 'tcx>, + param_env_and_substs: ty::ParamEnvAnd<'tcx, SubstsRef<'tcx>>, + tables: &'a ty::TypeckTables<'tcx>, + pat: &'tcx hir::Pat, + ) -> Self { let mut pcx = PatternContext::new(tcx, param_env_and_substs, tables); let result = pcx.lower_pattern(pat); if !pcx.errors.is_empty() { @@ -351,9 +353,11 @@ pub fn from_hir(tcx: TyCtxt<'a, 'tcx, 'tcx>, } impl<'a, 'tcx> PatternContext<'a, 'tcx> { - pub fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>, - param_env_and_substs: ty::ParamEnvAnd<'tcx, SubstsRef<'tcx>>, - tables: &'a ty::TypeckTables<'tcx>) -> Self { + pub fn new( + tcx: TyCtxt<'tcx, 'tcx>, + param_env_and_substs: ty::ParamEnvAnd<'tcx, SubstsRef<'tcx>>, + tables: &'a ty::TypeckTables<'tcx>, + ) -> Self { PatternContext { tcx, param_env: param_env_and_substs.param_env, @@ -1055,7 +1059,7 @@ fn const_to_pat( } impl UserAnnotatedTyHelpers<'tcx, 'tcx> for PatternContext<'_, 'tcx> { - fn tcx(&self) -> TyCtxt<'_, 'tcx, 'tcx> { + fn tcx(&self) -> TyCtxt<'tcx, 'tcx> { self.tcx } @@ -1242,8 +1246,8 @@ fn super_fold_with>(&self, folder: &mut F) -> Self { } } -pub fn compare_const_vals<'a, 'gcx, 'tcx>( - tcx: TyCtxt<'a, 'gcx, 'tcx>, +pub fn compare_const_vals<'gcx, 'tcx>( + tcx: TyCtxt<'gcx, 'tcx>, a: &'tcx ty::Const<'tcx>, b: &'tcx ty::Const<'tcx>, ty: ty::ParamEnvAnd<'tcx, Ty<'tcx>>,