@@ -569,9 +569,10 @@ fn quoted_as_module(
569
569
570
570
let path = parse ( argument, parser:: path_no_turbofish ( ) , "a path" ) . ok ( ) ;
571
571
let option_value = path. and_then ( |path| {
572
- let module = interpreter. elaborate_item ( interpreter. current_function , |elaborator| {
573
- elaborator. resolve_module_by_path ( path)
574
- } ) ;
572
+ let module = interpreter
573
+ . elaborate_in_function ( interpreter. current_function , |elaborator| {
574
+ elaborator. resolve_module_by_path ( path)
575
+ } ) ;
575
576
module. map ( Value :: ModuleDefinition )
576
577
} ) ;
577
578
@@ -587,7 +588,7 @@ fn quoted_as_trait_constraint(
587
588
let argument = check_one_argument ( arguments, location) ?;
588
589
let trait_bound = parse ( argument, parser:: trait_bound ( ) , "a trait constraint" ) ?;
589
590
let bound = interpreter
590
- . elaborate_item ( interpreter. current_function , |elaborator| {
591
+ . elaborate_in_function ( interpreter. current_function , |elaborator| {
591
592
elaborator. resolve_trait_bound ( & trait_bound, Type :: Unit )
592
593
} )
593
594
. ok_or ( InterpreterError :: FailedToResolveTraitBound { trait_bound, location } ) ?;
@@ -603,8 +604,8 @@ fn quoted_as_type(
603
604
) -> IResult < Value > {
604
605
let argument = check_one_argument ( arguments, location) ?;
605
606
let typ = parse ( argument, parser:: parse_type ( ) , "a type" ) ?;
606
- let typ =
607
- interpreter . elaborate_item ( interpreter. current_function , |elab| elab. resolve_type ( typ) ) ;
607
+ let typ = interpreter
608
+ . elaborate_in_function ( interpreter. current_function , |elab| elab. resolve_type ( typ) ) ;
608
609
Ok ( Value :: Type ( typ) )
609
610
}
610
611
@@ -1675,23 +1676,25 @@ fn expr_resolve(
1675
1676
interpreter. current_function
1676
1677
} ;
1677
1678
1678
- let value = interpreter. elaborate_item ( function_to_resolve_in, |elaborator| match expr_value {
1679
- ExprValue :: Expression ( expression_kind) => {
1680
- let expr = Expression { kind : expression_kind, span : self_argument_location. span } ;
1681
- let ( expr_id, _) = elaborator. elaborate_expression ( expr) ;
1682
- Value :: TypedExpr ( TypedExpr :: ExprId ( expr_id) )
1683
- }
1684
- ExprValue :: Statement ( statement_kind) => {
1685
- let statement = Statement { kind : statement_kind, span : self_argument_location. span } ;
1686
- let ( stmt_id, _) = elaborator. elaborate_statement ( statement) ;
1687
- Value :: TypedExpr ( TypedExpr :: StmtId ( stmt_id) )
1688
- }
1689
- ExprValue :: LValue ( lvalue) => {
1690
- let expr = lvalue. as_expression ( ) ;
1691
- let ( expr_id, _) = elaborator. elaborate_expression ( expr) ;
1692
- Value :: TypedExpr ( TypedExpr :: ExprId ( expr_id) )
1693
- }
1694
- } ) ;
1679
+ let value =
1680
+ interpreter. elaborate_in_function ( function_to_resolve_in, |elaborator| match expr_value {
1681
+ ExprValue :: Expression ( expression_kind) => {
1682
+ let expr = Expression { kind : expression_kind, span : self_argument_location. span } ;
1683
+ let ( expr_id, _) = elaborator. elaborate_expression ( expr) ;
1684
+ Value :: TypedExpr ( TypedExpr :: ExprId ( expr_id) )
1685
+ }
1686
+ ExprValue :: Statement ( statement_kind) => {
1687
+ let statement =
1688
+ Statement { kind : statement_kind, span : self_argument_location. span } ;
1689
+ let ( stmt_id, _) = elaborator. elaborate_statement ( statement) ;
1690
+ Value :: TypedExpr ( TypedExpr :: StmtId ( stmt_id) )
1691
+ }
1692
+ ExprValue :: LValue ( lvalue) => {
1693
+ let expr = lvalue. as_expression ( ) ;
1694
+ let ( expr_id, _) = elaborator. elaborate_expression ( expr) ;
1695
+ Value :: TypedExpr ( TypedExpr :: ExprId ( expr_id) )
1696
+ }
1697
+ } ) ;
1695
1698
1696
1699
Ok ( value)
1697
1700
}
@@ -1942,7 +1945,7 @@ fn function_def_set_parameters(
1942
1945
"a pattern" ,
1943
1946
) ?;
1944
1947
1945
- let hir_pattern = interpreter. elaborate_item ( Some ( func_id) , |elaborator| {
1948
+ let hir_pattern = interpreter. elaborate_in_function ( Some ( func_id) , |elaborator| {
1946
1949
elaborator. elaborate_pattern_and_store_ids (
1947
1950
parameter_pattern,
1948
1951
parameter_type. clone ( ) ,
0 commit comments