mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 10:08:20 +00:00
Use lifetimes in walk_expr() to guarantee that child expr has same lifetime as parent expr
This commit is contained in:
parent
7241e0503e
commit
51605ad2a4
1 changed files with 4 additions and 4 deletions
|
@ -2612,9 +2612,9 @@ pub fn unwrap_parens_owned(expr: ast::Expr) -> Result<(ast::Expr, usize)> {
|
|||
}
|
||||
|
||||
/// Recursively walks an immutable expression, applying a function to each sub-expression.
|
||||
pub fn walk_expr<F>(expr: &ast::Expr, func: &mut F) -> Result<()>
|
||||
pub fn walk_expr<'a, F>(expr: &'a ast::Expr, func: &mut F) -> Result<()>
|
||||
where
|
||||
F: FnMut(&ast::Expr) -> Result<()>,
|
||||
F: FnMut(&'a ast::Expr) -> Result<()>,
|
||||
{
|
||||
func(expr)?;
|
||||
match expr {
|
||||
|
@ -2788,9 +2788,9 @@ where
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn walk_expr_frame_bound<F>(bound: &ast::FrameBound, func: &mut F) -> Result<()>
|
||||
fn walk_expr_frame_bound<'a, F>(bound: &'a ast::FrameBound, func: &mut F) -> Result<()>
|
||||
where
|
||||
F: FnMut(&ast::Expr) -> Result<()>,
|
||||
F: FnMut(&'a ast::Expr) -> Result<()>,
|
||||
{
|
||||
match bound {
|
||||
ast::FrameBound::Following(expr) | ast::FrameBound::Preceding(expr) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue