---
source: crates/ruff_linter/src/linter.rs
---
resources/test/fixtures/syntax_errors/async_comprehension.py:5:8: PLE1142 `await` should be used within an async function
  |
4 | def regular_function():
5 |     [x async for x in elements(1)]
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^ PLE1142
6 |
7 |     async with elements(1) as x:
  |

resources/test/fixtures/syntax_errors/async_comprehension.py:7:5: PLE1142 `await` should be used within an async function
   |
 5 |       [x async for x in elements(1)]
 6 |
 7 | /     async with elements(1) as x:
 8 | |         pass
   | |____________^ PLE1142
 9 |
10 |       async for _ in elements(1):
   |

resources/test/fixtures/syntax_errors/async_comprehension.py:10:5: PLE1142 `await` should be used within an async function
   |
 8 |           pass
 9 |
10 | /     async for _ in elements(1):
11 | |         pass
   | |____________^ PLE1142
   |
