From efb876f5578f874c3e19462aac14dc262232c4ad Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Thu, 2 Jan 2020 23:34:00 +0000 Subject: rustdoc: Avoid panic when parsing codeblocks for playground links `make_test` is also called when parsing codeblocks for the playground links so it should handle unwinds from the parser internally. --- src/test/rustdoc/playground-syntax-error.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/test/rustdoc/playground-syntax-error.rs (limited to 'src/test/rustdoc') diff --git a/src/test/rustdoc/playground-syntax-error.rs b/src/test/rustdoc/playground-syntax-error.rs new file mode 100644 index 00000000000..8918ae874f8 --- /dev/null +++ b/src/test/rustdoc/playground-syntax-error.rs @@ -0,0 +1,21 @@ +#![crate_name = "foo"] +#![doc(html_playground_url = "https://play.rust-lang.org/")] + +/// bar docs +/// +/// ```edition2015 +/// use std::future::Future; +/// use std::pin::Pin; +/// fn foo_recursive(n: usize) -> Pin>> { +/// Box::pin(async move { +/// if n > 0 { +/// foo_recursive(n - 1).await; +/// } +/// }) +/// } +/// ``` +pub fn bar() {} + +// @has foo/fn.bar.html +// @has - '//a[@class="test-arrow"]' "Run" +// @has - '//*[@class="docblock"]' 'foo_recursive' -- cgit 1.4.1-3-g733a5