about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-09-28 22:37:59 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-09-29 13:01:41 +0200
commit6f5f21adfc88a914c507ba8c9a0f1f34ae292d44 (patch)
tree661442daf985bbe0cade1b34c6d753dddbfb7b64 /src
parent632fed891df4850e579b2c796de7e18b53d80daa (diff)
downloadrust-6f5f21adfc88a914c507ba8c9a0f1f34ae292d44.tar.gz
rust-6f5f21adfc88a914c507ba8c9a0f1f34ae292d44.zip
Rename doctest attribute `standalone-crate` into `standalone_crate` for coherency
Diffstat (limited to 'src')
-rw-r--r--src/doc/rustdoc/src/write-documentation/documentation-tests.md4
-rw-r--r--src/librustdoc/html/markdown.rs6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/doc/rustdoc/src/write-documentation/documentation-tests.md b/src/doc/rustdoc/src/write-documentation/documentation-tests.md
index 94ef34ea5a5..c93893b5ada 100644
--- a/src/doc/rustdoc/src/write-documentation/documentation-tests.md
+++ b/src/doc/rustdoc/src/write-documentation/documentation-tests.md
@@ -414,11 +414,11 @@ In some cases, doctests cannot be merged. For example, if you have:
 The problem with this code is that, if you change any other doctests, it'll likely break when
 runing `rustdoc --test`, making it tricky to maintain.
 
-This is where the `standalone-crate` attribute comes in: it tells `rustdoc` that a doctest
+This is where the `standalone_crate` attribute comes in: it tells `rustdoc` that a doctest
 should not be merged with the others. So the previous code should use it:
 
 ```rust
-//! ```standalone-crate
+//! ```standalone_crate
 //! let location = std::panic::Location::caller();
 //! assert_eq!(location.line(), 4);
 //! ```
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index e1a8dc6e50c..8ae5484feda 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -1264,7 +1264,7 @@ impl LangString {
                         seen_rust_tags = !seen_other_tags || seen_rust_tags;
                         data.no_run = true;
                     }
-                    LangStringToken::LangToken("standalone-crate") => {
+                    LangStringToken::LangToken("standalone_crate") => {
                         data.standalone_crate = true;
                         seen_rust_tags = !seen_other_tags || seen_rust_tags;
                     }
@@ -1315,12 +1315,12 @@ impl LangString {
                                 "use `test_harness` to run functions marked `#[test]` instead of a \
                                 potentially-implicit `main` function",
                             ),
-                            "standalone" | "standalone_crate" => {
+                            "standalone" | "standalone_crate" | "standalone-crate" => {
                                 if let Some(extra) = extra
                                     && extra.sp.at_least_rust_2024()
                                 {
                                     Some(
-                                        "use `standalone-crate` to compile this code block \
+                                        "use `standalone_crate` to compile this code block \
                                         separately",
                                     )
                                 } else {