Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 239a686

Browse files
authored
Merge pull request rust-lang#19237 from BenjaminBrienen/doc-tests
Doc tests
2 parents 494192b + 1b6c4b7 commit 239a686

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+77
-93
lines changed

src/tools/rust-analyzer/crates/base-db/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13-
doctest = false
1413

1514
[dependencies]
1615
lz4_flex = { version = "0.11", default-features = false }

src/tools/rust-analyzer/crates/cfg/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13-
doctest = false
1413

1514
[dependencies]
1615
rustc-hash.workspace = true

src/tools/rust-analyzer/crates/hir-def/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13-
doctest = false
1413

1514
[dependencies]
1615
arrayvec.workspace = true

src/tools/rust-analyzer/crates/hir-def/src/dyn_map.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
//!
66
//! It is used like this:
77
//!
8-
//! ```
8+
//! ```ignore
9+
//! # use hir_def::dyn_map::DynMap;
10+
//! # use hir_def::dyn_map::Key;
911
//! // keys define submaps of a `DynMap`
1012
//! const STRING_TO_U32: Key<String, u32> = Key::new();
1113
//! const U32_TO_VEC: Key<u32, Vec<bool>> = Key::new();

src/tools/rust-analyzer/crates/hir-def/src/item_tree.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,20 +883,20 @@ pub struct UseTree {
883883

884884
#[derive(Debug, Clone, Eq, PartialEq)]
885885
pub enum UseTreeKind {
886-
/// ```
886+
/// ```ignore
887887
/// use path::to::Item;
888888
/// use path::to::Item as Renamed;
889889
/// use path::to::Trait as _;
890890
/// ```
891891
Single { path: Interned<ModPath>, alias: Option<ImportAlias> },
892892

893-
/// ```
893+
/// ```ignore
894894
/// use *; // (invalid, but can occur in nested tree)
895895
/// use path::*;
896896
/// ```
897897
Glob { path: Option<Interned<ModPath>> },
898898

899-
/// ```
899+
/// ```ignore
900900
/// use prefix::{self, Item, ...};
901901
/// ```
902902
Prefixed { prefix: Option<Interned<ModPath>>, list: Box<[UseTree]> },

src/tools/rust-analyzer/crates/hir-def/src/nameres/mod_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl DirPath {
134134
/// So this is the case which doesn't really work I think if we try to be
135135
/// 100% platform agnostic:
136136
///
137-
/// ```
137+
/// ```ignore
138138
/// mod a {
139139
/// #[path="C://sad/face"]
140140
/// mod b { mod c; }

src/tools/rust-analyzer/crates/hir-def/src/resolver.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,16 +532,17 @@ impl Resolver {
532532
/// Note that in Rust one name can be bound to several items:
533533
///
534534
/// ```
535+
/// # #![allow(non_camel_case_types)]
535536
/// macro_rules! t { () => (()) }
536537
/// type t = t!();
537-
/// const t: t = t!()
538+
/// const t: t = t!();
538539
/// ```
539540
///
540541
/// That's why we return a multimap.
541542
///
542543
/// The shadowing is accounted for: in
543544
///
544-
/// ```
545+
/// ```ignore
545546
/// let it = 92;
546547
/// {
547548
/// let it = 92;

src/tools/rust-analyzer/crates/hir-expand/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13-
doctest = false
1413

1514
[dependencies]
1615
cov-mark = "2.0.0-pre.1"

src/tools/rust-analyzer/crates/hir-expand/src/builtin/attr_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn dummy_gate_test_expand(
101101
/// somewhat inconsistently resolve derive attributes.
102102
///
103103
/// As such, we expand `#[derive(Foo, bar::Bar)]` into
104-
/// ```
104+
/// ```ignore
105105
/// #![Foo]
106106
/// #![bar::Bar]
107107
/// ```

src/tools/rust-analyzer/crates/hir-ty/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13-
doctest = false
1413

1514
[dependencies]
1615
cov-mark = "2.0.0-pre.1"

0 commit comments

Comments
 (0)