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:
commit
03e8b6bbfa
49 changed files with 224 additions and 231 deletions
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue