Skip to content

Rustdoc: should_panic not applied for ```rust,should_panic code blocks #23744

Closed
@cjsut

Description

@cjsut

```should_panic, ```should_fail, and ```rust,should_fail all work fine.

Test case: Run rustdoc as rustdoc --test test.rs, where test.rs contains

#![crate_type = "bin"]
#![crate_name = "shouldpanic"]

/// Example of rustdoc incorrectly parsing <code>```rust,should_panic</code>.
///
/// ```should_panic
/// fn main() { panic!("fee"); }
/// ```
///
/// ```should_fail
/// fn main() { panic!("fi"); }
/// ```
///
/// ```rust,should_fail
/// fn main() { panic!("fo"); }
/// ```
///
/// ```rust,should_panic
/// fn main() { panic!("fum"); }
/// ```
fn main() {
    // We're actually just fine, thank you. :)
}

Metadata

Metadata

Assignees

Labels

T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions