forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
93 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<dyn Future<Output = ()>>> { | ||
/// 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' |