fix doc tests

This commit is contained in:
BenjaminBrienen 2025-02-27 00:59:13 +01:00
parent bd7375a58f
commit b19ef6b046
37 changed files with 75 additions and 61 deletions

View file

@ -10,7 +10,6 @@ license.workspace = true
rust-version.workspace = true
[lib]
doctest = false
[dependencies]
arrayvec.workspace = true

View file

@ -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<String, u32> = Key::new();
//! const U32_TO_VEC: Key<u32, Vec<bool>> = Key::new();

View file

@ -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<ModPath>, alias: Option<ImportAlias> },
/// ```
/// ```ignore
/// use *; // (invalid, but can occur in nested tree)
/// use path::*;
/// ```
Glob { path: Option<Interned<ModPath>> },
/// ```
/// ```ignore
/// use prefix::{self, Item, ...};
/// ```
Prefixed { prefix: Option<Interned<ModPath>>, list: Box<[UseTree]> },

View file

@ -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; }

View file

@ -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;