Skip to content

Commit

Permalink
Add FIXME about construct_async_arguments.
Browse files Browse the repository at this point in the history
This is unrelated to the rest of this PR but it made sense to add a
FIXME explaining that the function shouldn't really be in the parser.
  • Loading branch information
davidtwco committed May 9, 2019
1 parent dcd3cf7 commit d5e0406
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8730,6 +8730,10 @@ impl<'a> Parser<'a> {
/// The arguments of the function are replaced in HIR lowering with the arguments created by
/// this function and the statements created here are inserted at the top of the closure body.
fn construct_async_arguments(&mut self, asyncness: &mut Spanned<IsAsync>, decl: &mut FnDecl) {
// FIXME(davidtwco): This function should really live in the HIR lowering but because
// the types constructed here need to be used in parts of resolve so that the correct
// locals are considered upvars, it is currently easier for it to live here in the parser,
// where it can be constructed once.
if let IsAsync::Async { ref mut arguments, .. } = asyncness.node {
for (index, input) in decl.inputs.iter_mut().enumerate() {
let id = ast::DUMMY_NODE_ID;
Expand Down

0 comments on commit d5e0406

Please sign in to comment.