1
Fork 0

Rollup merge of #130294 - nnethercote:more-lifetimes, r=lcnr

Lifetime cleanups

The last commit is very opinionated, let's see how we go.

r? `@oli-obk`
This commit is contained in:
León Orell Valerian Liehr 2024-09-14 18:12:13 +02:00 committed by GitHub
commit 03e8b6bbfa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 224 additions and 231 deletions

View file

@ -134,13 +134,12 @@ fn parse_attribute(attr: &Attribute) -> MirPhase {
MirPhase::parse(dialect, phase)
}
struct ParseCtxt<'tcx, 'body> {
struct ParseCtxt<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
thir: &'body Thir<'tcx>,
thir: &'a Thir<'tcx>,
source_scope: SourceScope,
body: &'body mut Body<'tcx>,
body: &'a mut Body<'tcx>,
local_map: FxHashMap<LocalVarId, Local>,
block_map: FxHashMap<LocalVarId, BasicBlock>,
}
@ -151,7 +150,7 @@ struct ParseError {
expected: String,
}
impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
impl<'a, 'tcx> ParseCtxt<'a, 'tcx> {
fn expr_error(&self, expr: ExprId, expected: &'static str) -> ParseError {
let expr = &self.thir[expr];
ParseError {

View file

@ -68,7 +68,7 @@ macro_rules! parse_by_kind {
}
pub(crate) use parse_by_kind;
impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
impl<'a, 'tcx> ParseCtxt<'a, 'tcx> {
/// Expressions should only ever be matched on after preparsing them. This removes extra scopes
/// we don't care about.
fn preparse(&self, expr_id: ExprId) -> ExprId {

View file

@ -12,7 +12,7 @@ use super::{parse_by_kind, PResult, ParseCtxt};
use crate::build::custom::ParseError;
use crate::build::expr::as_constant::as_constant_inner;
impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
impl<'a, 'tcx> ParseCtxt<'a, 'tcx> {
pub(crate) fn parse_statement(&self, expr_id: ExprId) -> PResult<StatementKind<'tcx>> {
parse_by_kind!(self, expr_id, _, "statement",
@call(mir_storage_live, args) => {