mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 21:04:18 +00:00
fix doc tests
This commit is contained in:
parent
bd7375a58f
commit
b19ef6b046
37 changed files with 75 additions and 61 deletions
|
|
@ -10,7 +10,6 @@ license.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
arrayvec.workspace = true
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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]> },
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue