-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #84445 - jyn514:hidden, r=<try>
rustdoc: Hide `#text` in doc-tests Since `#![attr]` and `#[attr]` are the only valid syntax that start with `#`, we can just special case those two tokens. Fixes #83284.
- Loading branch information
Showing
3 changed files
with
44 additions
and
6 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,25 @@ | ||
// check-pass | ||
// compile-flags:--test | ||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" | ||
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" | ||
|
||
/// ``` | ||
// If `const_err` becomes a hard error in the future, please replace this with another | ||
// deny-by-default lint instead of removing it altogether | ||
/// # ! [allow(const_err)] | ||
/// const C: usize = 1/0; | ||
/// | ||
/// # use std::path::PathBuf; | ||
/// #use std::path::Path; | ||
/// let x = Path::new("y.rs"); | ||
/// let x = PathBuf::from("y.rs"); | ||
/// | ||
/// #[cfg(FALSE)] | ||
/// assert!(false); | ||
/// | ||
/// # [cfg(FALSE)] | ||
/// assert!(false); | ||
/// ``` | ||
fn main() { | ||
panic!(); | ||
} |
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,6 @@ | ||
|
||
running 1 test | ||
test $DIR/test-hidden.rs - main (line 6) ... ok | ||
|
||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME | ||
|