Skip to content

Commit 7e58930

Browse files
committed
Use a more precise lifetime
1 parent c1f62a7 commit 7e58930

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
996996
&self,
997997
err: &mut Diag<'_>,
998998
ty: Ty<'tcx>,
999-
expr: &'cx hir::Expr<'cx>,
999+
expr: &hir::Expr<'_>,
10001000
) {
10011001
let typeck_results = self.infcx.tcx.typeck(self.mir_def_id());
10021002
let hir::ExprKind::Struct(struct_qpath, fields, Some(base)) = expr.kind else { return };
@@ -1084,8 +1084,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
10841084
&self,
10851085
err: &mut Diag<'_>,
10861086
ty: Ty<'tcx>,
1087-
mut expr: &'cx hir::Expr<'cx>,
1088-
mut other_expr: Option<&'cx hir::Expr<'cx>>,
1087+
mut expr: &'tcx hir::Expr<'tcx>,
1088+
mut other_expr: Option<&'tcx hir::Expr<'tcx>>,
10891089
use_spans: Option<UseSpans<'tcx>>,
10901090
) {
10911091
if let hir::ExprKind::Struct(_, _, Some(_)) = expr.kind {
@@ -2016,7 +2016,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
20162016
);
20172017
}
20182018

2019-
pub(crate) fn find_expr(&self, span: Span) -> Option<&hir::Expr<'_>> {
2019+
pub(crate) fn find_expr(&self, span: Span) -> Option<&'tcx hir::Expr<'tcx>> {
20202020
let tcx = self.infcx.tcx;
20212021
let body_id = tcx.hir_node(self.mir_hir_id()).body_id()?;
20222022
let mut expr_finder = FindExprBySpan::new(span, tcx);

0 commit comments

Comments
 (0)