Skip to content

Commit 98b5ef5

Browse files
committed
Rust: Halt codegen on code block without ``` terminator
1 parent 24a1012 commit 98b5ef5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

misc/codegen/generators/rusttestgen.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def generate(opts, renderer):
5353
code.append(line)
5454
if not has_code:
5555
continue
56+
assert not adding_code, "Unterminated code block in docstring: " + "\n".join(cls.doc)
5657
test_name = inflection.underscore(cls.name)
5758
signature = cls.rust_doc_test_function
5859
fn = signature and Function(f"test_{test_name}", signature)

0 commit comments

Comments
 (0)