diff --git a/crates/base-db/Cargo.toml b/crates/base-db/Cargo.toml index 788ceb8857e9..042dd36488aa 100644 --- a/crates/base-db/Cargo.toml +++ b/crates/base-db/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] lz4_flex = { version = "0.11", default-features = false } diff --git a/crates/cfg/Cargo.toml b/crates/cfg/Cargo.toml index 040bddbd7fd3..e887368ef28f 100644 --- a/crates/cfg/Cargo.toml +++ b/crates/cfg/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] rustc-hash.workspace = true diff --git a/crates/hir-def/Cargo.toml b/crates/hir-def/Cargo.toml index 9a448ec14ea1..a22961c26c84 100644 --- a/crates/hir-def/Cargo.toml +++ b/crates/hir-def/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] arrayvec.workspace = true diff --git a/crates/hir-def/src/dyn_map.rs b/crates/hir-def/src/dyn_map.rs index e9318d146ddf..8868bc0cd95b 100644 --- a/crates/hir-def/src/dyn_map.rs +++ b/crates/hir-def/src/dyn_map.rs @@ -5,7 +5,9 @@ //! //! It is used like this: //! -//! ``` +//! ```ignore +//! # use hir_def::dyn_map::DynMap; +//! # use hir_def::dyn_map::Key; //! // keys define submaps of a `DynMap` //! const STRING_TO_U32: Key = Key::new(); //! const U32_TO_VEC: Key> = Key::new(); diff --git a/crates/hir-def/src/item_tree.rs b/crates/hir-def/src/item_tree.rs index 8d5b3eeb28e1..382afbcb1dd4 100644 --- a/crates/hir-def/src/item_tree.rs +++ b/crates/hir-def/src/item_tree.rs @@ -883,20 +883,20 @@ pub struct UseTree { #[derive(Debug, Clone, Eq, PartialEq)] pub enum UseTreeKind { - /// ``` + /// ```ignore /// use path::to::Item; /// use path::to::Item as Renamed; /// use path::to::Trait as _; /// ``` Single { path: Interned, alias: Option }, - /// ``` + /// ```ignore /// use *; // (invalid, but can occur in nested tree) /// use path::*; /// ``` Glob { path: Option> }, - /// ``` + /// ```ignore /// use prefix::{self, Item, ...}; /// ``` Prefixed { prefix: Option>, list: Box<[UseTree]> }, diff --git a/crates/hir-def/src/nameres/mod_resolution.rs b/crates/hir-def/src/nameres/mod_resolution.rs index afee42ecec0b..17d09bcbd047 100644 --- a/crates/hir-def/src/nameres/mod_resolution.rs +++ b/crates/hir-def/src/nameres/mod_resolution.rs @@ -134,7 +134,7 @@ impl DirPath { /// So this is the case which doesn't really work I think if we try to be /// 100% platform agnostic: /// - /// ``` + /// ```ignore /// mod a { /// #[path="C://sad/face"] /// mod b { mod c; } diff --git a/crates/hir-def/src/resolver.rs b/crates/hir-def/src/resolver.rs index 9dfb6e3cc4b7..e5774b48044f 100644 --- a/crates/hir-def/src/resolver.rs +++ b/crates/hir-def/src/resolver.rs @@ -532,16 +532,17 @@ impl Resolver { /// Note that in Rust one name can be bound to several items: /// /// ``` + /// # #![allow(non_camel_case_types)] /// macro_rules! t { () => (()) } /// type t = t!(); - /// const t: t = t!() + /// const t: t = t!(); /// ``` /// /// That's why we return a multimap. /// /// The shadowing is accounted for: in /// - /// ``` + /// ```ignore /// let it = 92; /// { /// let it = 92; diff --git a/crates/hir-expand/Cargo.toml b/crates/hir-expand/Cargo.toml index b193a34a01d9..7d561e0527d9 100644 --- a/crates/hir-expand/Cargo.toml +++ b/crates/hir-expand/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/hir-expand/src/builtin/attr_macro.rs b/crates/hir-expand/src/builtin/attr_macro.rs index f250620e775a..e9dc17a28f68 100644 --- a/crates/hir-expand/src/builtin/attr_macro.rs +++ b/crates/hir-expand/src/builtin/attr_macro.rs @@ -101,7 +101,7 @@ fn dummy_gate_test_expand( /// somewhat inconsistently resolve derive attributes. /// /// As such, we expand `#[derive(Foo, bar::Bar)]` into -/// ``` +/// ```ignore /// #![Foo] /// #![bar::Bar] /// ``` diff --git a/crates/hir-ty/Cargo.toml b/crates/hir-ty/Cargo.toml index 4d36de0b383c..27849f3b449d 100644 --- a/crates/hir-ty/Cargo.toml +++ b/crates/hir-ty/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/hir-ty/src/display.rs b/crates/hir-ty/src/display.rs index ae8fbe2ce6d7..49f061813d10 100644 --- a/crates/hir-ty/src/display.rs +++ b/crates/hir-ty/src/display.rs @@ -95,7 +95,7 @@ pub struct HirFormatter<'a> { enum BoundsFormattingCtx { Entered { /// We can have recursive bounds like the following case: - /// ```rust + /// ```ignore /// where /// T: Foo, /// T::FooAssoc: Baz<::BarAssoc> + Bar diff --git a/crates/hir-ty/src/infer.rs b/crates/hir-ty/src/infer.rs index 0cb7002f4460..556091c40461 100644 --- a/crates/hir-ty/src/infer.rs +++ b/crates/hir-ty/src/infer.rs @@ -335,7 +335,7 @@ impl Default for InternedStandardTypes { /// sized struct to a dynamically sized one. E.g., &[i32; 4] -> &[i32] is /// represented by: /// -/// ``` +/// ```ignore /// Deref(None) -> [i32; 4], /// Borrow(AutoBorrow::Ref) -> &[i32; 4], /// Unsize -> &[i32], @@ -481,9 +481,10 @@ pub struct InferenceResult { /// or pattern can have multiple binding modes. For example: /// ``` /// fn foo(mut slice: &[u32]) -> usize { - /// slice = match slice { - /// [0, rest @ ..] | rest => rest, - /// }; + /// slice = match slice { + /// [0, rest @ ..] | rest => rest, + /// }; + /// 0 /// } /// ``` /// the first `rest` has implicit `ref` binding mode, but the second `rest` binding mode is `move`. diff --git a/crates/hir/Cargo.toml b/crates/hir/Cargo.toml index c68ff706e481..2af3c2e4c351 100644 --- a/crates/hir/Cargo.toml +++ b/crates/hir/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] rustc-hash.workspace = true diff --git a/crates/hir/src/semantics/source_to_def.rs b/crates/hir/src/semantics/source_to_def.rs index 4481b8855fd6..18cbaa15aeae 100644 --- a/crates/hir/src/semantics/source_to_def.rs +++ b/crates/hir/src/semantics/source_to_def.rs @@ -5,7 +5,7 @@ //! //! This module solves the following problem: //! -//! Given a piece of syntax, find the corresponding semantic definition (def). +//! > Given a piece of syntax, find the corresponding semantic definition (def). //! //! This problem is a part of more-or-less every IDE feature implemented. Every //! IDE functionality (like goto to definition), conceptually starts with a diff --git a/crates/hir/src/term_search/expr.rs b/crates/hir/src/term_search/expr.rs index 6ad074e8e5c8..d2070f0e18b4 100644 --- a/crates/hir/src/term_search/expr.rs +++ b/crates/hir/src/term_search/expr.rs @@ -40,7 +40,7 @@ fn mod_item_path_str( /// Type tree shows how can we get from set of types to some type. /// /// Consider the following code as an example -/// ``` +/// ```ignore /// fn foo(x: i32, y: bool) -> Option { None } /// fn bar() { /// let a = 1; diff --git a/crates/ide-assists/Cargo.toml b/crates/ide-assists/Cargo.toml index ba215868710e..3768c2257cad 100644 --- a/crates/ide-assists/Cargo.toml +++ b/crates/ide-assists/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/ide-assists/src/handlers/convert_comment_from_or_to_doc.rs b/crates/ide-assists/src/handlers/convert_comment_from_or_to_doc.rs index c7b1314c861e..5a9db67a5fb6 100644 --- a/crates/ide-assists/src/handlers/convert_comment_from_or_to_doc.rs +++ b/crates/ide-assists/src/handlers/convert_comment_from_or_to_doc.rs @@ -136,7 +136,7 @@ fn comment_to_doc(acc: &mut Assists, comment: ast::Comment, style: CommentPlacem /// Not all comments are valid candidates for conversion into doc comments. For example, the /// comments in the code: -/// ```rust +/// ```ignore /// // Brilliant module right here /// /// // Really good right @@ -148,7 +148,7 @@ fn comment_to_doc(acc: &mut Assists, comment: ast::Comment, style: CommentPlacem /// mod nice_module {} /// ``` /// can be converted to doc comments. However, the comments in this example: -/// ```rust +/// ```ignore /// fn foo_bar(foo: Foo /* not bar yet */) -> Bar { /// foo.into_bar() /// // Nicely done @@ -162,7 +162,7 @@ fn comment_to_doc(acc: &mut Assists, comment: ast::Comment, style: CommentPlacem /// are not allowed to become doc comments. Moreover, some comments _are_ allowed, but aren't common /// style in Rust. For example, the following comments are allowed to be doc comments, but it is not /// common style for them to be: -/// ```rust +/// ```ignore /// fn foo_bar(foo: Foo) -> Bar { /// // this could be an inner comment with //! /// foo.into_bar() diff --git a/crates/ide-assists/src/handlers/extract_function.rs b/crates/ide-assists/src/handlers/extract_function.rs index 967da41c15f7..751e4a5a5719 100644 --- a/crates/ide-assists/src/handlers/extract_function.rs +++ b/crates/ide-assists/src/handlers/extract_function.rs @@ -272,7 +272,7 @@ fn make_function_name(semantics_scope: &hir::SemanticsScope<'_>) -> ast::NameRef /// * We want whole node, like `loop {}`, `2 + 2`, `{ let n = 1; }` exprs. /// Then we can use `ast::Expr` /// * We want a few statements for a block. E.g. -/// ```rust,no_run +/// ```ignore /// fn foo() -> i32 { /// let m = 1; /// $0 @@ -386,7 +386,7 @@ struct ContainerInfo { /// Control flow that is exported from extracted function /// /// E.g.: -/// ```rust,no_run +/// ```ignore /// loop { /// $0 /// if 42 == 42 { diff --git a/crates/ide-assists/src/handlers/generate_function.rs b/crates/ide-assists/src/handlers/generate_function.rs index 8f5daa4125a3..91e248a1de51 100644 --- a/crates/ide-assists/src/handlers/generate_function.rs +++ b/crates/ide-assists/src/handlers/generate_function.rs @@ -1037,7 +1037,7 @@ fn filter_bounds_in_scope( /// Makes duplicate argument names unique by appending incrementing numbers. /// -/// ``` +/// ```ignore /// let mut names: Vec = /// vec!["foo".into(), "foo".into(), "bar".into(), "baz".into(), "bar".into()]; /// deduplicate_arg_names(&mut names); diff --git a/crates/ide-assists/src/handlers/inline_type_alias.rs b/crates/ide-assists/src/handlers/inline_type_alias.rs index 66dffde505c1..76d465b01103 100644 --- a/crates/ide-assists/src/handlers/inline_type_alias.rs +++ b/crates/ide-assists/src/handlers/inline_type_alias.rs @@ -276,7 +276,7 @@ impl ConstAndTypeMap { /// 1. Map the provided instance's generic args to the type alias's generic /// params: /// -/// ``` +/// ```ignore /// type A<'a, const N: usize, T = u64> = &'a [T; N]; /// ^ alias generic params /// let a: A<100>; diff --git a/crates/ide-completion/Cargo.toml b/crates/ide-completion/Cargo.toml index 1bef82af5ac9..68cc7a0b9a6d 100644 --- a/crates/ide-completion/Cargo.toml +++ b/crates/ide-completion/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/ide-completion/src/context.rs b/crates/ide-completion/src/context.rs index 7862b258789c..919b30f7f971 100644 --- a/crates/ide-completion/src/context.rs +++ b/crates/ide-completion/src/context.rs @@ -249,8 +249,8 @@ pub(crate) enum Qualified { /// This would be None, if path is not solely made of /// `super` segments, e.g. /// - /// ```rust - /// use super::foo; + /// ```ignore + /// use super::foo; /// ``` /// /// Otherwise it should be Some(count of `super`) diff --git a/crates/ide-completion/src/context/analysis.rs b/crates/ide-completion/src/context/analysis.rs index eecd412bc43e..1a34548f7082 100644 --- a/crates/ide-completion/src/context/analysis.rs +++ b/crates/ide-completion/src/context/analysis.rs @@ -97,7 +97,8 @@ fn token_at_offset_ignore_whitespace(file: &SyntaxNode, offset: TextSize) -> Opt /// We do this by recursively expanding all macros and picking the best possible match. We cannot just /// choose the first expansion each time because macros can expand to something that does not include /// our completion marker, e.g.: -/// ``` +/// +/// ```ignore /// macro_rules! helper { ($v:ident) => {} } /// macro_rules! my_macro { /// ($v:ident) => { @@ -106,7 +107,7 @@ fn token_at_offset_ignore_whitespace(file: &SyntaxNode, offset: TextSize) -> Opt /// }; /// } /// -/// my_macro!(complete_me_here) +/// my_macro!(complete_me_here); /// ``` /// If we would expand the first thing we encounter only (which in fact this method used to do), we would /// be unable to complete here, because we would be walking directly into the void. So we instead try diff --git a/crates/ide-completion/src/item.rs b/crates/ide-completion/src/item.rs index 41a82409597b..b3dd8a8d06eb 100644 --- a/crates/ide-completion/src/item.rs +++ b/crates/ide-completion/src/item.rs @@ -149,9 +149,9 @@ pub struct CompletionRelevance { /// This is set when the identifier being completed matches up with the name that is expected, /// like in a function argument. /// - /// ``` + /// ```ignore /// fn f(spam: String) {} - /// fn main { + /// fn main() { /// let spam = 92; /// f($0) // name of local matches the name of param /// } @@ -161,7 +161,7 @@ pub struct CompletionRelevance { pub type_match: Option, /// Set for local variables. /// - /// ``` + /// ```ignore /// fn foo(a: u32) { /// let b = 0; /// $0 // `a` and `b` are local @@ -195,7 +195,7 @@ pub struct CompletionRelevanceTraitInfo { pub enum CompletionRelevanceTypeMatch { /// This is set in cases like these: /// - /// ``` + /// ```ignore /// enum Option { Some(T), None } /// fn f(a: Option) {} /// fn main { @@ -205,9 +205,9 @@ pub enum CompletionRelevanceTypeMatch { CouldUnify, /// This is set in cases where the type matches the expected type, like: /// - /// ``` + /// ```ignore /// fn f(spam: String) {} - /// fn main { + /// fn main() { /// let foo = String::new(); /// f($0) // type of local matches the type of param /// } @@ -221,7 +221,7 @@ pub enum CompletionRelevancePostfixMatch { NonExact, /// This is set in cases like these: /// - /// ``` + /// ```ignore /// (a > b).not$0 /// ``` /// diff --git a/crates/ide-completion/src/lib.rs b/crates/ide-completion/src/lib.rs index a1f2eaeb1b6d..a990b39481a1 100644 --- a/crates/ide-completion/src/lib.rs +++ b/crates/ide-completion/src/lib.rs @@ -143,7 +143,7 @@ impl CompletionFieldsToResolve { /// already present, it should give all possible variants for the identifier at /// the caret. In other words, for /// -/// ```no_run +/// ```ignore /// fn f() { /// let foo = 92; /// let _ = bar$0 diff --git a/crates/ide-db/Cargo.toml b/crates/ide-db/Cargo.toml index c8a8a2d16981..641998c3daca 100644 --- a/crates/ide-db/Cargo.toml +++ b/crates/ide-db/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/ide-db/src/path_transform.rs b/crates/ide-db/src/path_transform.rs index f045e44dd318..126b30470b7e 100644 --- a/crates/ide-db/src/path_transform.rs +++ b/crates/ide-db/src/path_transform.rs @@ -32,7 +32,7 @@ type DefaultedParam = Either; /// block), you generally want to appropriately qualify the names, and sometimes /// you might want to substitute generic parameters as well: /// -/// ``` +/// ```ignore /// mod x { /// pub struct A; /// pub trait T { fn foo(&self, _: U) -> A; } diff --git a/crates/ide-db/src/source_change.rs b/crates/ide-db/src/source_change.rs index 27ff91dc19d9..34642d7eaf9d 100644 --- a/crates/ide-db/src/source_change.rs +++ b/crates/ide-db/src/source_change.rs @@ -493,7 +493,7 @@ pub enum Snippet { Placeholder(TextRange), /// A group of placeholder snippets, e.g. /// - /// ```no_run + /// ```ignore /// let ${0:new_var} = 4; /// fun(1, 2, 3, ${0:new_var}); /// ``` diff --git a/crates/ide-db/src/syntax_helpers/suggest_name.rs b/crates/ide-db/src/syntax_helpers/suggest_name.rs index 0a7141c19b6b..e085bf15cb92 100644 --- a/crates/ide-db/src/syntax_helpers/suggest_name.rs +++ b/crates/ide-db/src/syntax_helpers/suggest_name.rs @@ -79,7 +79,9 @@ const USELESS_METHODS: &[&str] = &[ /// the name, e.g. `a`, `a1`, `a2`, ... /// /// # Examples -/// ```rust +/// +/// ``` +/// # use ide_db::syntax_helpers::suggest_name::NameGenerator; /// let mut generator = NameGenerator::new(); /// assert_eq!(generator.suggest_name("a"), "a"); /// assert_eq!(generator.suggest_name("a"), "a1"); diff --git a/crates/ide-diagnostics/Cargo.toml b/crates/ide-diagnostics/Cargo.toml index 281a08e5429f..483cb6df8623 100644 --- a/crates/ide-diagnostics/Cargo.toml +++ b/crates/ide-diagnostics/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/ide-diagnostics/src/lib.rs b/crates/ide-diagnostics/src/lib.rs index 3ea41aa7e859..0a55b6e9bee8 100644 --- a/crates/ide-diagnostics/src/lib.rs +++ b/crates/ide-diagnostics/src/lib.rs @@ -697,7 +697,7 @@ struct SeverityAttr { /// #[warn(non_snake_case)] /// mod foo { /// #[allow(nonstandard_style)] - /// mod bar; + /// mod bar {} /// } /// ``` /// We want to not warn on non snake case inside `bar`. If we are traversing this for the first diff --git a/crates/ide-ssr/Cargo.toml b/crates/ide-ssr/Cargo.toml index 256146762888..fa75e5a42147 100644 --- a/crates/ide-ssr/Cargo.toml +++ b/crates/ide-ssr/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index 7c66b36dc8e9..9af56c40e982 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/intern/Cargo.toml b/crates/intern/Cargo.toml index c0358ef929b4..397eba092967 100644 --- a/crates/intern/Cargo.toml +++ b/crates/intern/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] diff --git a/crates/mbe/Cargo.toml b/crates/mbe/Cargo.toml index b37d57f28012..e6fbb298ebdb 100644 --- a/crates/mbe/Cargo.toml +++ b/crates/mbe/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/mbe/src/parser.rs b/crates/mbe/src/parser.rs index 16d55492a04b..0a670053c988 100644 --- a/crates/mbe/src/parser.rs +++ b/crates/mbe/src/parser.rs @@ -13,8 +13,8 @@ use crate::ParseError; /// Consider /// /// ``` -/// macro_rules! an_macro { -/// ($x:expr + $y:expr) => ($y * $x) +/// macro_rules! a_macro { +/// ($x:expr, $y:expr) => ($y * $x) /// } /// ``` /// diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml index 48436ec71f7a..a36a39dbee6c 100644 --- a/crates/parser/Cargo.toml +++ b/crates/parser/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] drop_bomb = "0.1.5" diff --git a/crates/parser/src/input.rs b/crates/parser/src/input.rs index c90b358cfbb4..cabdff214df3 100644 --- a/crates/parser/src/input.rs +++ b/crates/parser/src/input.rs @@ -36,7 +36,7 @@ impl Input { /// the *previous* token was joint, with mbe, you know whether the *current* /// one is joint. This API allows for styles of usage: /// - /// ``` + /// ```ignore /// // In text: /// tokens.was_joint(prev_joint); /// tokens.push(curr); diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index e461492cc6f9..398ad7cf66ce 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -59,7 +59,7 @@ pub use crate::{ /// /// That is, for something like /// -/// ``` +/// ```ignore /// quick_check! { /// fn prop() {} /// } diff --git a/crates/parser/src/output.rs b/crates/parser/src/output.rs index 386d03a62cc1..0ea15a656c1b 100644 --- a/crates/parser/src/output.rs +++ b/crates/parser/src/output.rs @@ -16,8 +16,9 @@ pub struct Output { /// 32-bit encoding of events. If LSB is zero, then that's an index into the /// error vector. Otherwise, it's one of the thee other variants, with data encoded as /// - /// |16 bit kind|8 bit n_input_tokens|4 bit tag|4 bit leftover| - /// + /// ```text + /// |16 bit kind|8 bit n_input_tokens|4 bit tag|4 bit leftover| + /// `````` event: Vec, error: Vec, } diff --git a/crates/paths/Cargo.toml b/crates/paths/Cargo.toml index f0dafab70c16..4cc70726da0b 100644 --- a/crates/paths/Cargo.toml +++ b/crates/paths/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] camino.workspace = true diff --git a/crates/paths/src/lib.rs b/crates/paths/src/lib.rs index 008424416169..3d722b1ff115 100644 --- a/crates/paths/src/lib.rs +++ b/crates/paths/src/lib.rs @@ -232,7 +232,7 @@ impl AbsPath { /// - Removes trailing slashes: `/a/b/` becomes `/a/b`. /// /// # Example - /// ``` + /// ```ignore /// # use paths::AbsPathBuf; /// let abs_path_buf = AbsPathBuf::assert("/a/../../b/.//c//".into()); /// let normalized = abs_path_buf.normalize(); diff --git a/crates/proc-macro-api/Cargo.toml b/crates/proc-macro-api/Cargo.toml index dac8e0943576..f5ba40a994b1 100644 --- a/crates/proc-macro-api/Cargo.toml +++ b/crates/proc-macro-api/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] serde.workspace = true diff --git a/crates/proc-macro-srv/Cargo.toml b/crates/proc-macro-srv/Cargo.toml index 191535ac55e9..d3b56b402ea8 100644 --- a/crates/proc-macro-srv/Cargo.toml +++ b/crates/proc-macro-srv/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] object.workspace = true diff --git a/crates/proc-macro-srv/proc-macro-test/Cargo.toml b/crates/proc-macro-srv/proc-macro-test/Cargo.toml index 7c6a1ba46b5f..16fcc9296207 100644 --- a/crates/proc-macro-srv/proc-macro-test/Cargo.toml +++ b/crates/proc-macro-srv/proc-macro-test/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" license = "MIT OR Apache-2.0" [lib] -doctest = false [build-dependencies] cargo_metadata = "0.18.1" diff --git a/crates/proc-macro-srv/proc-macro-test/imp/Cargo.toml b/crates/proc-macro-srv/proc-macro-test/imp/Cargo.toml index fa189752b76f..fb98d758a8b7 100644 --- a/crates/proc-macro-srv/proc-macro-test/imp/Cargo.toml +++ b/crates/proc-macro-srv/proc-macro-test/imp/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" publish = false [lib] -doctest = false proc-macro = true [dependencies] diff --git a/crates/profile/Cargo.toml b/crates/profile/Cargo.toml index 65eec868af3d..9384fe265584 100644 --- a/crates/profile/Cargo.toml +++ b/crates/profile/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cfg-if = "1.0.0" diff --git a/crates/project-model/Cargo.toml b/crates/project-model/Cargo.toml index ed647950e663..83def0e6b2a9 100644 --- a/crates/project-model/Cargo.toml +++ b/crates/project-model/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] anyhow.workspace = true diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 64c8afdc1f74..6c81c238fd3f 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -13,7 +13,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [[bin]] name = "rust-analyzer" diff --git a/crates/rust-analyzer/src/op_queue.rs b/crates/rust-analyzer/src/op_queue.rs index 123f20605ab3..709d99bda751 100644 --- a/crates/rust-analyzer/src/op_queue.rs +++ b/crates/rust-analyzer/src/op_queue.rs @@ -6,7 +6,7 @@ pub(crate) type Cause = String; /// A single-item queue that allows callers to request an operation to /// be performed later. /// -/// ``` +/// ```ignore /// let queue = OpQueue::default(); /// /// // Request work to be done. diff --git a/crates/rust-analyzer/src/tracing/config.rs b/crates/rust-analyzer/src/tracing/config.rs index 02ae4186ab69..4f208b6c5dd6 100644 --- a/crates/rust-analyzer/src/tracing/config.rs +++ b/crates/rust-analyzer/src/tracing/config.rs @@ -31,7 +31,7 @@ pub struct Config { /// that specify level. pub chalk_filter: Option, /// Filtering syntax, set in a shell: - /// ``` + /// ```text /// env RA_PROFILE=* // dump everything /// env RA_PROFILE=foo|bar|baz // enabled only selected entries /// env RA_PROFILE=*@3>10 // dump everything, up to depth 3, if it takes more than 10 @@ -39,7 +39,7 @@ pub struct Config { pub profile_filter: Option, /// Filtering syntax, set in a shell: - /// ``` + /// ```text /// env RA_PROFILE_JSON=foo|bar|baz /// ``` pub json_profile_filter: Option, diff --git a/crates/rust-analyzer/src/tracing/hprof.rs b/crates/rust-analyzer/src/tracing/hprof.rs index d466acef0115..5b18762bb974 100644 --- a/crates/rust-analyzer/src/tracing/hprof.rs +++ b/crates/rust-analyzer/src/tracing/hprof.rs @@ -6,7 +6,8 @@ //! //! Usage: //! -//! ```rust +//! ```ignore +//! # use tracing_subscriber::Registry; //! let layer = hprof::SpanTree::default(); //! Registry::default().with(layer).init(); //! ``` diff --git a/crates/rust-analyzer/src/tracing/json.rs b/crates/rust-analyzer/src/tracing/json.rs index 9e35990a5bc8..f5394d023a10 100644 --- a/crates/rust-analyzer/src/tracing/json.rs +++ b/crates/rust-analyzer/src/tracing/json.rs @@ -2,7 +2,8 @@ //! //! Usage: //! -//! ```rust +//! ```ignore +//! # use tracing_subscriber::Registry; //! let layer = json::TimingLayer::new(std::io::stderr); //! Registry::default().with(layer).init(); //! ``` diff --git a/crates/stdx/Cargo.toml b/crates/stdx/Cargo.toml index 62c32d68e6fb..3727d0c9562e 100644 --- a/crates/stdx/Cargo.toml +++ b/crates/stdx/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] backtrace = { version = "0.3.67", optional = true } diff --git a/crates/stdx/src/anymap.rs b/crates/stdx/src/anymap.rs index 91fab8e92380..faf2e6c71789 100644 --- a/crates/stdx/src/anymap.rs +++ b/crates/stdx/src/anymap.rs @@ -83,7 +83,8 @@ pub type RawMap = hash_map::HashMap, BuildHasherDefault[anymap::Map][Map]::<[core::any::Any]>::new() instead if desired.) /// -/// ```rust +/// ``` +/// # use stdx::anymap; #[doc = "let mut data = anymap::AnyMap::new();"] /// assert_eq!(data.get(), None::<&i32>); /// ``` diff --git a/crates/stdx/src/macros.rs b/crates/stdx/src/macros.rs index 85d9008fe123..880e2da70fc3 100644 --- a/crates/stdx/src/macros.rs +++ b/crates/stdx/src/macros.rs @@ -34,7 +34,7 @@ macro_rules! format_to_acc { /// /// # Example /// -/// ```rust +/// ```ignore /// impl_from!(Struct, Union, Enum for Adt); /// ``` #[macro_export] diff --git a/crates/syntax-bridge/Cargo.toml b/crates/syntax-bridge/Cargo.toml index f9a9f40541d5..3e663422a04e 100644 --- a/crates/syntax-bridge/Cargo.toml +++ b/crates/syntax-bridge/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] rustc-hash.workspace = true diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index 51eaea54346d..3fe6e01dc3c9 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] cov-mark = "2.0.0-pre.1" diff --git a/crates/syntax/src/algo.rs b/crates/syntax/src/algo.rs index 3b85b137aa9b..a8a83893946a 100644 --- a/crates/syntax/src/algo.rs +++ b/crates/syntax/src/algo.rs @@ -25,7 +25,7 @@ pub fn ancestors_at_offset( /// imprecise: if the cursor is strictly between two nodes of the desired type, /// as in /// -/// ```no_run +/// ```ignore /// struct Foo {}|struct Bar; /// ``` /// diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs index 579f3ba8b4fe..052d018e5c9e 100644 --- a/crates/syntax/src/ast/edit.rs +++ b/crates/syntax/src/ast/edit.rs @@ -72,9 +72,9 @@ impl IndentLevel { } /// XXX: this intentionally doesn't change the indent of the very first token. - /// Ie, in something like + /// For example, in something like: /// ``` - /// fn foo() { + /// fn foo() -> i32 { /// 92 /// } /// ``` diff --git a/crates/test-utils/Cargo.toml b/crates/test-utils/Cargo.toml index b1457722a922..b99a2c4bd75c 100644 --- a/crates/test-utils/Cargo.toml +++ b/crates/test-utils/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] # Avoid adding deps here, this crate is widely used in tests it should compile fast! diff --git a/crates/test-utils/src/assert_linear.rs b/crates/test-utils/src/assert_linear.rs index 15c30c52a548..f78bf59a2fdc 100644 --- a/crates/test-utils/src/assert_linear.rs +++ b/crates/test-utils/src/assert_linear.rs @@ -11,7 +11,7 @@ //! Ideally, we should use a proper "model selection" to directly compare //! quadratic and linear models, but that sounds rather complicated: //! -//! https://stats.stackexchange.com/questions/21844/selecting-best-model-based-on-linear-quadratic-and-cubic-fit-of-data +//! > https://stats.stackexchange.com/questions/21844/selecting-best-model-based-on-linear-quadratic-and-cubic-fit-of-data //! //! We might get false positives on a VM, but never false negatives. So, if the //! first round fails, we repeat the ordeal three more times and fail only if diff --git a/crates/test-utils/src/fixture.rs b/crates/test-utils/src/fixture.rs index 7fe26d53bf21..daeb56c5835c 100644 --- a/crates/test-utils/src/fixture.rs +++ b/crates/test-utils/src/fixture.rs @@ -6,7 +6,8 @@ //! Use this to test functionality local to one file. //! //! Simple Example: -//! ``` +//! +//! ```ignore //! r#" //! fn main() { //! println!("Hello World") @@ -19,7 +20,8 @@ //! which is also how to define multiple files in a single test fixture //! //! Example using two files in the same crate: -//! ``` +//! +//! ```ignore //! " //! //- /main.rs //! mod foo; @@ -33,7 +35,8 @@ //! ``` //! //! Example using two crates with one file each, with one crate depending on the other: -//! ``` +//! +//! ```ignore //! r#" //! //- /main.rs crate:a deps:b //! fn main() { @@ -51,7 +54,8 @@ //! for the syntax. //! //! Example using some available metadata: -//! ``` +//! +//! ```ignore //! " //! //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo //! fn insert_source_code_here() {} diff --git a/crates/toolchain/Cargo.toml b/crates/toolchain/Cargo.toml index 87e8efb20fc6..38daacdf951a 100644 --- a/crates/toolchain/Cargo.toml +++ b/crates/toolchain/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] home = "0.5.4" diff --git a/crates/tt/Cargo.toml b/crates/tt/Cargo.toml index 82e7c24668fe..529fad3244a6 100644 --- a/crates/tt/Cargo.toml +++ b/crates/tt/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] arrayvec.workspace = true diff --git a/crates/vfs-notify/Cargo.toml b/crates/vfs-notify/Cargo.toml index bc54d7168f09..48b4d22de2f0 100644 --- a/crates/vfs-notify/Cargo.toml +++ b/crates/vfs-notify/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] tracing.workspace = true diff --git a/crates/vfs/Cargo.toml b/crates/vfs/Cargo.toml index e8a6195036ed..546195481c6a 100644 --- a/crates/vfs/Cargo.toml +++ b/crates/vfs/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true rust-version.workspace = true [lib] -doctest = false [dependencies] rustc-hash.workspace = true diff --git a/crates/vfs/src/anchored_path.rs b/crates/vfs/src/anchored_path.rs index db15a2a21cd6..1b9fb355b481 100644 --- a/crates/vfs/src/anchored_path.rs +++ b/crates/vfs/src/anchored_path.rs @@ -2,7 +2,7 @@ //! //! The primary goal of this is to losslessly represent paths like //! -//! ``` +//! ```ignore //! #[path = "./bar.rs"] //! mod foo; //! ``` diff --git a/crates/vfs/src/vfs_path.rs b/crates/vfs/src/vfs_path.rs index 3c8e37413f68..cce8595cc4a9 100644 --- a/crates/vfs/src/vfs_path.rs +++ b/crates/vfs/src/vfs_path.rs @@ -59,7 +59,7 @@ impl VfsPath { /// /// # Example /// - /// ``` + /// ```ignore /// # use vfs::{AbsPathBuf, VfsPath}; /// let mut path = VfsPath::from(AbsPathBuf::assert("/foo/bar".into())); /// assert!(path.pop());