Skip to content

Conversation

@fmease
Copy link
Member

@fmease fmease commented Oct 27, 2025

They were fully untested and undocumented previously despite being stable.
Context: #t-rustdoc > `test_harness` langstr @ 💬.

While at it, I've also improved the documentation for code block attributes in general.
I was only inspired to do so because there was no good place for test_harness and because it got hard to skim due to a lack of subsubsections.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Oct 27, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 27, 2025

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

None,
Some(Vec<String>),
}

Copy link
Member Author

@fmease fmease Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not any old ENBF1 (variant), it's ABNF2 specifically (from IETF RFC 5234) which I previously didn't know about (and thus was confused about the syntax).

Footnotes

  1. Extended Backus-Naur form.

  2. Augmented Backus-Naur form.

/// delimited-attribute-list = OPEN-CURLY-BRACKET attribute-list CLOSE-CURLY-BRACKET
/// token-list = [sep] token *(sep token) [sep]
/// comment = OPEN_PAREN *(all characters) CLOSE_PAREN
/// comment = OPEN_PAREN *<all characters except closing parentheses> CLOSE_PAREN
Copy link
Member Author

@fmease fmease Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prose terminals are to be denoted by <…> not by (…) (which is grouping) per IETF RFC 5234 (Ctrl+F for prose-val).

@fmease fmease force-pushed the rustdoc-test-n-doc-doctest-test-harness branch from eab1d61 to 5e7f083 Compare October 27, 2025 18:05
@rust-log-analyzer

This comment has been minimized.

@fmease fmease force-pushed the rustdoc-test-n-doc-doctest-test-harness branch from 5e7f083 to c687f89 Compare October 27, 2025 18:53
@rust-log-analyzer

This comment has been minimized.

@fmease fmease force-pushed the rustdoc-test-n-doc-doctest-test-harness branch from c687f89 to f71d897 Compare October 27, 2025 19:41
@rust-log-analyzer

This comment has been minimized.

@fmease fmease force-pushed the rustdoc-test-n-doc-doctest-test-harness branch from f71d897 to 9a78729 Compare October 27, 2025 20:24
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
To only update this specific test, also pass `--test-args doctest/test-harness.rs`

error: 1 errors occurred comparing output.
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="0" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustdoc" "/checkout/tests/rustdoc-ui/doctest/test-harness.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/rustdoc-ui/doctest/test-harness" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Cdebuginfo=0" "--test" "--test-args" "--test-threads=1"
--- stdout -------------------------------

running 4 tests
test /checkout/tests/rustdoc-ui/doctest/test-harness.rs - (line 14) ... FAILED
test /checkout/tests/rustdoc-ui/doctest/test-harness.rs - (line 25) ... FAILED
---
test group::element ... FAILED

failures:

---- group::element stdout ----

thread 'group::element' (321554) panicked at /checkout/tests/rustdoc-ui/doctest/test-harness.rs:6:9:
assertion failed: false
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
---
---- /checkout/tests/rustdoc-ui/doctest/test-harness.rs - (line 34) stdout ----
error: non-item macro in item position: assert
##[error]  --> /checkout/tests/rustdoc-ui/doctest/test-harness.rs:35:1
   |
LL | assert!(true);
   | ^^^^^^^^^^^^^

error: aborting due to 1 previous error

Couldn't compile the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants