Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/item_tree/tests.rs')
-rw-r--r--crates/hir-def/src/item_tree/tests.rs101
1 files changed, 36 insertions, 65 deletions
diff --git a/crates/hir-def/src/item_tree/tests.rs b/crates/hir-def/src/item_tree/tests.rs
index 824fbfa592..91b42bef8f 100644
--- a/crates/hir-def/src/item_tree/tests.rs
+++ b/crates/hir-def/src/item_tree/tests.rs
@@ -35,23 +35,23 @@ use a::{c, d::{e}};
#![no_std]
#![doc = " another file comment"]
- // AstId: 1
+ // AstId: ExternCrate[070B, 0]
pub(self) extern crate self as renamed;
- // AstId: 2
- pub(super) extern crate bli;
+ // AstId: ExternCrate[1EA5, 0]
+ pub(in super) extern crate bli;
- // AstId: 3
+ // AstId: Use[0000, 0]
pub use crate::path::{nested, items as renamed, Trait as _};
- // AstId: 4
+ // AstId: Use[0000, 1]
pub(self) use globs::*;
#[doc = " docs on import"]
- // AstId: 5
+ // AstId: Use[0000, 2]
pub(self) use crate::{A, B};
- // AstId: 6
+ // AstId: Use[0000, 3]
pub(self) use a::{c, d::{e}};
"##]],
);
@@ -73,23 +73,23 @@ extern "C" {
fn ex_fn();
}
"#,
- expect![[r##"
+ expect![[r#"
#[on_extern_block]
- // AstId: 1
- extern "C" {
+ // AstId: ExternBlock[0000, 0]
+ extern {
#[on_extern_type]
- // AstId: 2
+ // AstId: TypeAlias[A09C, 0]
pub(self) type ExType;
#[on_extern_static]
- // AstId: 3
+ // AstId: Static[D85E, 0]
pub(self) static EX_STATIC = _;
#[on_extern_fn]
- // AstId: 4
+ // AstId: Fn[B240, 0]
pub(self) fn ex_fn;
}
- "##]],
+ "#]],
);
}
@@ -124,44 +124,21 @@ enum E {
}
"#,
expect![[r#"
- // AstId: 1
+ // AstId: Struct[ED35, 0]
pub(self) struct Unit;
#[derive(Debug)]
- // AstId: 2
- pub(self) struct Struct {
- #[doc = " fld docs"]
- pub(self) fld,
- }
+ // AstId: Struct[A47C, 0]
+ pub(self) struct Struct { ... }
- // AstId: 3
- pub(self) struct Tuple(
- #[attr]
- pub(self) 0,
- );
+ // AstId: Struct[C8C9, 0]
+ pub(self) struct Tuple(...);
- // AstId: 4
- pub(self) union Ize {
- pub(self) a,
- pub(self) b,
- }
+ // AstId: Union[2797, 0]
+ pub(self) union Ize { ... }
- // AstId: 5
- pub(self) enum E
- // AstId: 6
- #[doc = " comment on Unit"]
- Unit,
- // AstId: 7
- #[doc = " comment on Tuple"]
- Tuple(
- pub(self) 0,
- ),
- // AstId: 8
- Struct {
- #[doc = " comment on a: u8"]
- pub(self) a,
- },
- }
+ // AstId: Enum[7D23, 0]
+ pub(self) enum E { ... }
"#]],
);
}
@@ -185,25 +162,19 @@ trait Tr: SuperTrait + 'lifetime {
}
"#,
expect![[r#"
- // AstId: 1
+ // AstId: Static[F7C1, 0]
pub static ST = _;
- // AstId: 2
+ // AstId: Const[84BB, 0]
pub(self) const _ = _;
#[attr]
#[inner_attr_in_fn]
- // AstId: 3
+ // AstId: Fn[BE8F, 0]
pub(self) fn f;
- // AstId: 4
- pub(self) trait Tr {
- // AstId: 6
- pub(self) type Assoc;
-
- // AstId: 7
- pub(self) fn method;
- }
+ // AstId: Trait[9320, 0]
+ pub(self) trait Tr { ... }
"#]],
);
}
@@ -226,16 +197,16 @@ mod outline;
expect![[r##"
#[doc = " outer"]
#[doc = " inner"]
- // AstId: 1
+ // AstId: Module[03AE, 0]
pub(self) mod inline {
- // AstId: 3
+ // AstId: Use[0000, 0]
pub(self) use super::*;
- // AstId: 4
+ // AstId: Fn[2A78, 0]
pub(self) fn fn_in_module;
}
- // AstId: 2
+ // AstId: Module[C08B, 0]
pub(self) mod outline;
"##]],
);
@@ -254,13 +225,13 @@ pub macro m2() {}
m!();
"#,
expect![[r#"
- // AstId: 1
+ // AstId: MacroRules[7E68, 0]
macro_rules! m { ... }
- // AstId: 2
+ // AstId: MacroDef[1C1E, 0]
pub macro m2 { ... }
- // AstId: 3, SyntaxContextId: ROOT2024, ExpandTo: Items
+ // AstId: MacroCall[7E68, 0], SyntaxContextId: ROOT2024, ExpandTo: Items
m!(...);
"#]],
);
@@ -273,7 +244,7 @@ fn pub_self() {
pub(self) struct S;
"#,
expect![[r#"
- // AstId: 1
+ // AstId: Struct[5024, 0]
pub(self) struct S;
"#]],
)