minor: Sort ide-completions test outputs for less disruptive diffs

This commit is contained in:
Lukas Wirth 2022-05-05 10:49:43 +02:00
parent 8b092ec337
commit 5280e08c13
21 changed files with 993 additions and 992 deletions

View file

@ -190,9 +190,9 @@ pub mod m {
fn foo(a: lib::m::A) { a.$0 } fn foo(a: lib::m::A) { a.$0 }
"#, "#,
expect![[r#" expect![[r#"
fd crate_field u32
fd private_field u32 fd private_field u32
fd pub_field u32 fd pub_field u32
fd crate_field u32
fd super_field u32 fd super_field u32
"#]], "#]],
); );
@ -248,8 +248,8 @@ mod m {
fn foo(a: lib::A) { a.$0 } fn foo(a: lib::A) { a.$0 }
"#, "#,
expect![[r#" expect![[r#"
me private_method() fn(&self)
me crate_method() fn(&self) me crate_method() fn(&self)
me private_method() fn(&self)
me pub_method() fn(&self) me pub_method() fn(&self)
"#]], "#]],
); );
@ -686,11 +686,11 @@ struct Foo { field: i32 }
impl Foo { fn foo(&self) { $0 } }"#, impl Foo { fn foo(&self) { $0 } }"#,
expect![[r#" expect![[r#"
fd self.field i32 fd self.field i32
me self.foo() fn(&self)
lc self &Foo lc self &Foo
sp Self sp Self
st Foo st Foo
bt u32 bt u32
me self.foo() fn(&self)
"#]], "#]],
); );
check( check(
@ -700,11 +700,11 @@ struct Foo(i32);
impl Foo { fn foo(&mut self) { $0 } }"#, impl Foo { fn foo(&mut self) { $0 } }"#,
expect![[r#" expect![[r#"
fd self.0 i32 fd self.0 i32
me self.foo() fn(&mut self)
lc self &mut Foo lc self &mut Foo
sp Self sp Self
st Foo st Foo
bt u32 bt u32
me self.foo() fn(&mut self)
"#]], "#]],
); );
} }

View file

@ -205,8 +205,8 @@ mod tests {
r"fn my_fn() { unsafe $0 }", r"fn my_fn() { unsafe $0 }",
expect![[r#" expect![[r#"
kw fn kw fn
kw trait
kw impl kw impl
kw trait
sn pd sn pd
sn ppd sn ppd
"#]], "#]],
@ -225,15 +225,15 @@ fn foo(a: A) { a.$0 }
"#, "#,
expect![[r#" expect![[r#"
kw await expr.await kw await expr.await
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr) sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr) sn dbg dbg!(expr)
sn dbgr dbg!(&expr) sn dbgr dbg!(&expr)
sn call function(expr)
sn let let sn let let
sn letm let mut sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]], "#]],
); );
@ -248,15 +248,15 @@ fn foo() {
"#, "#,
expect![[r#" expect![[r#"
kw await expr.await kw await expr.await
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr) sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr) sn dbg dbg!(expr)
sn dbgr dbg!(&expr) sn dbgr dbg!(&expr)
sn call function(expr)
sn let let sn let let
sn letm let mut sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]], "#]],
) )
} }

View file

@ -182,8 +182,8 @@ fn bar() {}
fn ignored_bar() {} fn ignored_bar() {}
"#, "#,
expect![[r#" expect![[r#"
md foo;
md bar; md bar;
md foo;
"#]], "#]],
); );
} }
@ -219,8 +219,8 @@ fn bar() {}
fn ignored_bar() {} fn ignored_bar() {}
"#, "#,
expect![[r#" expect![[r#"
md foo;
md bar; md bar;
md foo;
"#]], "#]],
); );
} }
@ -346,8 +346,8 @@ fn bar() {}
fn ignored_bar() {} fn ignored_bar() {}
"#, "#,
expect![[r#" expect![[r#"
md foo;
md bar; md bar;
md foo;
"#]], "#]],
); );
} }

View file

@ -309,18 +309,18 @@ fn main() {
} }
"#, "#,
expect![[r#" expect![[r#"
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn if if expr {} sn if if expr {}
sn while while expr {} sn let let
sn letm let mut
sn match match expr {}
sn not !expr sn not !expr
sn ref &expr sn ref &expr
sn refm &mut expr sn refm &mut expr
sn match match expr {} sn while while expr {}
sn box Box::new(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn call function(expr)
sn let let
sn letm let mut
"#]], "#]],
); );
} }
@ -339,16 +339,16 @@ fn main() {
} }
"#, "#,
expect![[r#" expect![[r#"
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn if if expr {} sn if if expr {}
sn while while expr {} sn match match expr {}
sn not !expr sn not !expr
sn ref &expr sn ref &expr
sn refm &mut expr sn refm &mut expr
sn match match expr {} sn while while expr {}
sn box Box::new(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn call function(expr)
"#]], "#]],
); );
} }
@ -363,15 +363,15 @@ fn main() {
} }
"#, "#,
expect![[r#" expect![[r#"
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr) sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr) sn dbg dbg!(expr)
sn dbgr dbg!(&expr) sn dbgr dbg!(&expr)
sn call function(expr)
sn let let sn let let
sn letm let mut sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]], "#]],
) )
} }
@ -386,18 +386,18 @@ fn main() {
} }
"#, "#,
expect![[r#" expect![[r#"
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn if if expr {} sn if if expr {}
sn while while expr {} sn let let
sn letm let mut
sn match match expr {}
sn not !expr sn not !expr
sn ref &expr sn ref &expr
sn refm &mut expr sn refm &mut expr
sn match match expr {} sn while while expr {}
sn box Box::new(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn call function(expr)
sn let let
sn letm let mut
"#]], "#]],
); );
} }

View file

@ -249,8 +249,8 @@ impl S {
fn foo() { let _ = lib::S::$0 } fn foo() { let _ = lib::S::$0 }
"#, "#,
expect![[r#" expect![[r#"
fn public_method() fn()
ct PUBLIC_CONST pub const PUBLIC_CONST: u32 ct PUBLIC_CONST pub const PUBLIC_CONST: u32
fn public_method() fn()
ta PublicType pub type PublicType = u32 ta PublicType pub type PublicType = u32
"#]], "#]],
); );
@ -340,14 +340,14 @@ trait Sub: Super {
fn foo<T: Sub>() { T::$0 } fn foo<T: Sub>() { T::$0 }
"#, "#,
expect![[r#" expect![[r#"
ta SubTy (as Sub) type SubTy
ta Ty (as Super) type Ty
ct C2 (as Sub) const C2: () ct C2 (as Sub) const C2: ()
fn subfunc() (as Sub) fn()
me submethod() (as Sub) fn(&self)
ct CONST (as Super) const CONST: u8 ct CONST (as Super) const CONST: u8
fn func() (as Super) fn() fn func() (as Super) fn()
fn subfunc() (as Sub) fn()
ta SubTy (as Sub) type SubTy
ta Ty (as Super) type Ty
me method() (as Super) fn(&self) me method() (as Super) fn(&self)
me submethod() (as Sub) fn(&self)
"#]], "#]],
); );
} }
@ -380,13 +380,13 @@ impl<T> Sub for Wrap<T> {
} }
"#, "#,
expect![[r#" expect![[r#"
ta SubTy (as Sub) type SubTy ct C2 (as Sub) const C2: ()
ta Ty (as Super) type Ty
ct CONST (as Super) const CONST: u8 ct CONST (as Super) const CONST: u8
fn func() (as Super) fn() fn func() (as Super) fn()
me method() (as Super) fn(&self)
ct C2 (as Sub) const C2: ()
fn subfunc() (as Sub) fn() fn subfunc() (as Sub) fn()
ta SubTy (as Sub) type SubTy
ta Ty (as Super) type Ty
me method() (as Super) fn(&self)
me submethod() (as Sub) fn(&self) me submethod() (as Sub) fn(&self)
"#]], "#]],
); );
@ -404,8 +404,8 @@ impl T { fn bar() {} }
fn main() { T::$0; } fn main() { T::$0; }
"#, "#,
expect![[r#" expect![[r#"
fn foo() fn()
fn bar() fn() fn bar() fn()
fn foo() fn()
"#]], "#]],
); );
} }
@ -518,8 +518,8 @@ fn main() { m!(self::f$0); }
fn foo() {} fn foo() {}
"#, "#,
expect![[r#" expect![[r#"
fn main() fn()
fn foo() fn() fn foo() fn()
fn main() fn()
"#]], "#]],
); );
} }
@ -536,8 +536,8 @@ mod m {
} }
"#, "#,
expect![[r#" expect![[r#"
md z
fn z() fn() fn z() fn()
md z
"#]], "#]],
); );
} }

View file

@ -343,8 +343,8 @@ impl Test for T {
", ",
expect![[r#" expect![[r#"
sp Self sp Self
tt Test
st T st T
tt Test
bt u32 bt u32
"#]], "#]],
); );
@ -448,8 +448,8 @@ impl Test for T {
", ",
expect![[r#" expect![[r#"
sp Self sp Self
tt Test
st T st T
tt Test
bt u32 bt u32
"#]], "#]],
); );
@ -465,8 +465,8 @@ impl Test for T {
", ",
expect![[r#" expect![[r#"
sp Self sp Self
tt Test
st T st T
tt Test
bt u32 bt u32
"#]], "#]],
); );
@ -484,8 +484,8 @@ impl Test for T {
", ",
expect![[r#" expect![[r#"
sp Self sp Self
tt Test
st T st T
tt Test
bt u32 bt u32
"#]], "#]],
); );
@ -532,8 +532,8 @@ impl Test for T {
", ",
expect![[r#" expect![[r#"
sp Self sp Self
tt Test
st T st T
tt Test
bt u32 bt u32
"#]], "#]],
); );
@ -549,8 +549,8 @@ impl Test for T {
", ",
expect![[r#" expect![[r#"
sp Self sp Self
tt Test
st T st T
tt Test
bt u32 bt u32
"#]], "#]],
); );

View file

@ -176,8 +176,8 @@ pub mod prelude {
"#, "#,
expect![[r#" expect![[r#"
md std md std
bt u32
st Option st Option
bt u32
"#]], "#]],
); );
} }
@ -233,10 +233,10 @@ pub mod prelude {
} }
"#, "#,
expect![[r#" expect![[r#"
md std
md core md core
bt u32 md std
st String st String
bt u32
"#]], "#]],
); );
} }

View file

@ -268,7 +268,7 @@ impl CompletionRelevance {
} }
/// The type of the completion item. /// The type of the completion item.
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum CompletionItemKind { pub enum CompletionItemKind {
SymbolKind(SymbolKind), SymbolKind(SymbolKind),
Binding, Binding,

View file

@ -98,6 +98,7 @@ fn completion_list_with_config(
}) })
.filter(|it| include_keywords || it.kind() != CompletionItemKind::Keyword) .filter(|it| include_keywords || it.kind() != CompletionItemKind::Keyword)
.filter(|it| include_keywords || it.kind() != CompletionItemKind::Snippet) .filter(|it| include_keywords || it.kind() != CompletionItemKind::Snippet)
.sorted_by_key(|it| (it.kind(), it.label().to_owned(), it.detail().map(ToOwned::to_owned)))
.collect(); .collect();
render_completion_list(items) render_completion_list(items)
} }

View file

@ -17,25 +17,25 @@ fn proc_macros() {
struct Foo; struct Foo;
"#, "#,
expect![[r#" expect![[r#"
md proc_macros
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at derive()
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle at no_mangle
at derive()
at repr()
at non_exhaustive at non_exhaustive
at repr()
at warn()
md proc_macros
kw crate::
kw self::
kw super::
"#]], "#]],
) )
} }
@ -77,15 +77,15 @@ fn with_existing_attr() {
check( check(
r#"#[no_mangle] #[$0] mcall!();"#, r#"#[no_mangle] #[$0] mcall!();"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid() at forbid()
at warn() at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
) )
} }
@ -95,29 +95,29 @@ fn attr_on_source_file() {
check( check(
r#"#![$0]"#, r#"#![$0]"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at crate_name = ""
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at must_use at doc(hidden)
at no_mangle
at crate_name = ""
at feature() at feature()
at forbid()
at must_use
at no_implicit_prelude at no_implicit_prelude
at no_main at no_main
at no_mangle
at no_std at no_std
at recursion_limit = "" at recursion_limit = ""
at type_length_limit = at type_length_limit =
at warn()
at windows_subsystem = "" at windows_subsystem = ""
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -127,44 +127,44 @@ fn attr_on_module() {
check( check(
r#"#[$0] mod foo;"#, r#"#[$0] mod foo;"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at macro_use
at must_use at must_use
at no_mangle at no_mangle
at macro_use
at path = "" at path = ""
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
check( check(
r#"mod foo {#![$0]}"#, r#"mod foo {#![$0]}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle
at no_implicit_prelude at no_implicit_prelude
at no_mangle
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -174,23 +174,23 @@ fn attr_on_macro_rules() {
check( check(
r#"#[$0] macro_rules! foo {}"#, r#"#[$0] macro_rules! foo {}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at must_use at doc(hidden)
at no_mangle at forbid()
at macro_export at macro_export
at macro_use at macro_use
at must_use
at no_mangle
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -200,21 +200,21 @@ fn attr_on_macro_def() {
check( check(
r#"#[$0] macro foo {}"#, r#"#[$0] macro foo {}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle at no_mangle
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -224,22 +224,22 @@ fn attr_on_extern_crate() {
check( check(
r#"#[$0] extern crate foo;"#, r#"#[$0] extern crate foo;"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at macro_use
at must_use at must_use
at no_mangle at no_mangle
at macro_use at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -249,21 +249,21 @@ fn attr_on_use() {
check( check(
r#"#[$0] use foo;"#, r#"#[$0] use foo;"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle at no_mangle
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -273,21 +273,21 @@ fn attr_on_type_alias() {
check( check(
r#"#[$0] type foo = ();"#, r#"#[$0] type foo = ();"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle at no_mangle
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -301,26 +301,26 @@ fn attr_on_struct() {
struct Foo; struct Foo;
"#, "#,
expect![[r#" expect![[r#"
md core
at derive macro derive
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at derive macro derive
at derive()
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle at no_mangle
at derive()
at repr()
at non_exhaustive at non_exhaustive
at repr()
at warn()
md core
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -330,24 +330,24 @@ fn attr_on_enum() {
check( check(
r#"#[$0] enum Foo {}"#, r#"#[$0] enum Foo {}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at derive()
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle at no_mangle
at derive()
at repr()
at non_exhaustive at non_exhaustive
at repr()
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -357,21 +357,21 @@ fn attr_on_const() {
check( check(
r#"#[$0] const FOO: () = ();"#, r#"#[$0] const FOO: () = ();"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle at no_mangle
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -381,26 +381,26 @@ fn attr_on_static() {
check( check(
r#"#[$0] static FOO: () = ()"#, r#"#[$0] static FOO: () = ()"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at must_use at doc(hidden)
at no_mangle
at export_name = "" at export_name = ""
at forbid()
at global_allocator
at link_name = "" at link_name = ""
at link_section = "" at link_section = ""
at global_allocator at must_use
at no_mangle
at used at used
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -410,22 +410,22 @@ fn attr_on_trait() {
check( check(
r#"#[$0] trait Foo {}"#, r#"#[$0] trait Foo {}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use
at must_use at must_use
at no_mangle at no_mangle
at must_use at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -435,42 +435,42 @@ fn attr_on_impl() {
check( check(
r#"#[$0] impl () {}"#, r#"#[$0] impl () {}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at automatically_derived
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle at no_mangle
at automatically_derived at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
check( check(
r#"impl () {#![$0]}"#, r#"impl () {#![$0]}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at must_use at must_use
at no_mangle at no_mangle
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -480,43 +480,43 @@ fn attr_on_extern_block() {
check( check(
r#"#[$0] extern {}"#, r#"#[$0] extern {}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at link
at must_use at must_use
at no_mangle at no_mangle
at link at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
check( check(
r#"extern {#![$0]}"#, r#"extern {#![$0]}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at doc(hidden)
at forbid()
at link
at must_use at must_use
at no_mangle at no_mangle
at link at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -526,16 +526,16 @@ fn attr_on_variant() {
check( check(
r#"enum Foo { #[$0] Bar }"#, r#"enum Foo { #[$0] Bar }"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid() at forbid()
at warn()
at non_exhaustive at non_exhaustive
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -545,36 +545,36 @@ fn attr_on_fn() {
check( check(
r#"#[$0] fn main() {}"#, r#"#[$0] fn main() {}"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at cold
at deny() at deny()
at forbid()
at warn()
at deprecated at deprecated
at doc = "" at doc = ""
at doc(hidden)
at doc(alias = "") at doc(alias = "")
at must_use at doc(hidden)
at no_mangle
at export_name = "" at export_name = ""
at link_name = "" at forbid()
at link_section = ""
at cold
at ignore = "" at ignore = ""
at inline at inline
at link_name = ""
at link_section = ""
at must_use at must_use
at must_use
at no_mangle
at panic_handler at panic_handler
at proc_macro at proc_macro
at proc_macro_derive()
at proc_macro_attribute at proc_macro_attribute
at proc_macro_derive()
at should_panic at should_panic
at target_feature = "" at target_feature = ""
at test at test
at track_caller at track_caller
at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -585,15 +585,15 @@ fn attr_on_expr() {
check( check(
r#"fn main() { #[$0] foo() }"#, r#"fn main() { #[$0] foo() }"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at cfg() at cfg()
at cfg_attr() at cfg_attr()
at deny() at deny()
at forbid() at forbid()
at warn() at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -603,9 +603,6 @@ fn attr_in_source_file_end() {
check( check(
r#"#[$0]"#, r#"#[$0]"#,
expect![[r#" expect![[r#"
kw self::
kw super::
kw crate::
at allow() at allow()
at automatically_derived at automatically_derived
at cfg() at cfg()
@ -642,6 +639,9 @@ fn attr_in_source_file_end() {
at track_caller at track_caller
at used at used
at warn() at warn()
kw crate::
kw self::
kw super::
"#]], "#]],
); );
} }
@ -654,8 +654,8 @@ mod cfg {
check( check(
r#"#[cfg(target_endian = $0"#, r#"#[cfg(target_endian = $0"#,
expect![[r#" expect![[r#"
ba little
ba big ba big
ba little
"#]], "#]],
); );
} }
@ -688,17 +688,17 @@ mod derive {
#[derive($0)] struct Test; #[derive($0)] struct Test;
"#, "#,
expect![[r#" expect![[r#"
md core de Clone macro Clone
de Default macro Default
de Clone, Copy de Clone, Copy
de Default macro Default
de PartialEq macro PartialEq de PartialEq macro PartialEq
de PartialEq, Eq de PartialEq, Eq
de PartialEq, Eq, PartialOrd, Ord de PartialEq, Eq, PartialOrd, Ord
de Clone macro Clone
de PartialEq, PartialOrd de PartialEq, PartialOrd
md core
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
"#]], "#]],
); );
} }
@ -711,16 +711,16 @@ mod derive {
#[derive(serde::Serialize, PartialEq, $0)] struct Test; #[derive(serde::Serialize, PartialEq, $0)] struct Test;
"#, "#,
expect![[r#" expect![[r#"
md core de Clone macro Clone
de Default macro Default
de Clone, Copy de Clone, Copy
de Default macro Default
de Eq de Eq
de Eq, PartialOrd, Ord de Eq, PartialOrd, Ord
de Clone macro Clone
de PartialOrd de PartialOrd
md core
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
"#]], "#]],
) )
} }
@ -733,16 +733,16 @@ mod derive {
#[derive($0 serde::Serialize, PartialEq)] struct Test; #[derive($0 serde::Serialize, PartialEq)] struct Test;
"#, "#,
expect![[r#" expect![[r#"
md core de Clone macro Clone
de Default macro Default
de Clone, Copy de Clone, Copy
de Default macro Default
de Eq de Eq
de Eq, PartialOrd, Ord de Eq, PartialOrd, Ord
de Clone macro Clone
de PartialOrd de PartialOrd
md core
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
"#]], "#]],
); );
} }
@ -755,15 +755,15 @@ mod derive {
#[derive(PartialEq, Eq, Or$0)] struct Test; #[derive(PartialEq, Eq, Or$0)] struct Test;
"#, "#,
expect![[r#" expect![[r#"
md core
de Default macro Default
de Clone, Copy
de PartialOrd, Ord
de Clone macro Clone de Clone macro Clone
de Clone, Copy
de Default macro Default
de PartialOrd de PartialOrd
de PartialOrd, Ord
md core
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
"#]], "#]],
); );
} }
@ -777,12 +777,12 @@ mod derive {
#[derive(der$0)] struct Test; #[derive(der$0)] struct Test;
"#, "#,
expect![[r#" expect![[r#"
md proc_macros de DeriveIdentity (use proc_macros::DeriveIdentity) proc_macro DeriveIdentity
md core md core
md proc_macros
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
de DeriveIdentity (use proc_macros::DeriveIdentity) proc_macro DeriveIdentity
"#]], "#]],
); );
check_derive( check_derive(
@ -794,11 +794,11 @@ use proc_macros::DeriveIdentity;
"#, "#,
expect![[r#" expect![[r#"
de DeriveIdentity proc_macro DeriveIdentity de DeriveIdentity proc_macro DeriveIdentity
md proc_macros
md core md core
md proc_macros
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
"#]], "#]],
); );
} }
@ -953,22 +953,22 @@ mod repr {
check_repr( check_repr(
r#"#[repr($0)] struct Test;"#, r#"#[repr($0)] struct Test;"#,
expect![[r#" expect![[r#"
ba C
ba align($0) ba align($0)
ba i16
ba i28
ba i32
ba i64
ba i8
ba isize
ba packed ba packed
ba transparent ba transparent
ba C ba u128
ba u8
ba u16 ba u16
ba u32 ba u32
ba u64 ba u64
ba u128 ba u8
ba usize ba usize
ba i8
ba i16
ba i32
ba i64
ba i28
ba isize
"#]], "#]],
); );
} }
@ -983,20 +983,20 @@ mod repr {
check_repr( check_repr(
r#"#[repr(align(1), $0)] struct Test;"#, r#"#[repr(align(1), $0)] struct Test;"#,
expect![[r#" expect![[r#"
ba transparent
ba C ba C
ba u8 ba i16
ba i28
ba i32
ba i64
ba i8
ba isize
ba transparent
ba u128
ba u16 ba u16
ba u32 ba u32
ba u64 ba u64
ba u128 ba u8
ba usize ba usize
ba i8
ba i16
ba i32
ba i64
ba i28
ba isize
"#]], "#]],
); );
} }
@ -1006,20 +1006,20 @@ mod repr {
check_repr( check_repr(
r#"#[repr(packed, $0)] struct Test;"#, r#"#[repr(packed, $0)] struct Test;"#,
expect![[r#" expect![[r#"
ba transparent
ba C ba C
ba u8 ba i16
ba i28
ba i32
ba i64
ba i8
ba isize
ba transparent
ba u128
ba u16 ba u16
ba u32 ba u32
ba u64 ba u64
ba u128 ba u8
ba usize ba usize
ba i8
ba i16
ba i32
ba i64
ba i28
ba isize
"#]], "#]],
); );
} }
@ -1030,19 +1030,19 @@ mod repr {
r#"#[repr(C, $0)] struct Test;"#, r#"#[repr(C, $0)] struct Test;"#,
expect![[r#" expect![[r#"
ba align($0) ba align($0)
ba i16
ba i28
ba i32
ba i64
ba i8
ba isize
ba packed ba packed
ba u8 ba u128
ba u16 ba u16
ba u32 ba u32
ba u64 ba u64
ba u128 ba u8
ba usize ba usize
ba i8
ba i16
ba i32
ba i64
ba i28
ba isize
"#]], "#]],
); );
} }
@ -1052,9 +1052,9 @@ mod repr {
check_repr( check_repr(
r#"#[repr(usize, $0)] struct Test;"#, r#"#[repr(usize, $0)] struct Test;"#,
expect![[r#" expect![[r#"
ba C
ba align($0) ba align($0)
ba packed ba packed
ba C
"#]], "#]],
); );
} }

View file

@ -31,38 +31,38 @@ fn baz() {
"#, "#,
// This should not contain `FooDesc {…}`. // This should not contain `FooDesc {…}`.
expect![[r#" expect![[r#"
kw unsafe ct CONST
kw match en Enum
kw while fn baz() fn()
kw while let fn create_foo() fn(&FooDesc)
kw loop fn function() fn()
ma makro!() macro_rules! makro
md _69latrick
md module
sc STATIC
st FooDesc
st Record
st Tuple
st Unit
tt Trait
un Union
ev TupleV() TupleV(u32)
bt u32
kw crate
kw false
kw for
kw if kw if
kw if let kw if let
kw for kw loop
kw true kw match
kw false
kw mut kw mut
kw return kw return
kw self kw self
kw super kw super
kw crate kw true
st FooDesc kw unsafe
fn create_foo() fn(&FooDesc) kw while
bt u32 kw while let
tt Trait
en Enum
st Record
st Tuple
md module
fn baz() fn()
st Unit
md _69latrick
ma makro!() macro_rules! makro
fn function() fn()
sc STATIC
un Union
ev TupleV() TupleV(u32)
ct CONST
"#]], "#]],
) )
} }
@ -83,28 +83,28 @@ fn func(param0 @ (param1, param2): (i32, i32)) {
} }
"#, "#,
expect![[r#" expect![[r#"
kw unsafe fn func() fn((i32, i32))
kw match
kw while
kw while let
kw loop
kw if
kw if let
kw for
kw true
kw false
kw return
kw self
kw super
kw crate
lc matcharm i32
lc ifletlocal i32 lc ifletlocal i32
lc letlocal i32 lc letlocal i32
lc matcharm i32
lc param0 (i32, i32) lc param0 (i32, i32)
lc param1 i32 lc param1 i32
lc param2 i32 lc param2 i32
fn func() fn((i32, i32))
bt u32 bt u32
kw crate
kw false
kw for
kw if
kw if let
kw loop
kw match
kw return
kw self
kw super
kw true
kw unsafe
kw while
kw while let
"#]], "#]],
); );
} }
@ -126,57 +126,57 @@ impl Unit {
"#, "#,
// `self` is in here twice, once as the module, once as the local // `self` is in here twice, once as the module, once as the local
expect![[r#" expect![[r#"
me self.foo() fn(self) ct CONST
kw unsafe
kw fn
kw const
kw type
kw impl
kw extern
kw use
kw trait
kw static
kw mod
kw enum
kw struct
kw union
kw match
kw while
kw while let
kw loop
kw if
kw if let
kw for
kw true
kw false
kw let
kw return
sn pd
sn ppd
sn macro_rules
kw self
kw super
kw crate
fn local_func() fn()
bt u32
lc self Unit
tp TypeParam
cp CONST_PARAM cp CONST_PARAM
sp Self
tt Trait
en Enum en Enum
fn function() fn()
fn local_func() fn()
lc self Unit
ma makro!() macro_rules! makro
md module
md qualified
sp Self
sc STATIC
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
md qualified tt Trait
ma makro!() macro_rules! makro tp TypeParam
?? Unresolved
fn function() fn()
sc STATIC
un Union un Union
ev TupleV() TupleV(u32) ev TupleV() TupleV(u32)
ct CONST bt u32
kw const
kw crate
kw enum
kw extern
kw false
kw fn
kw for
kw if
kw if let
kw impl
kw let
kw loop
kw match
kw mod
kw return
kw self
kw static
kw struct
kw super
kw trait
kw true
kw type
kw union
kw unsafe
kw use
kw while
kw while let
me self.foo() fn(self)
sn macro_rules
sn pd
sn ppd
?? Unresolved
"#]], "#]],
); );
check( check(
@ -192,20 +192,20 @@ impl Unit {
} }
"#, "#,
expect![[r#" expect![[r#"
tt Trait ct CONST
en Enum en Enum
fn function() fn()
ma makro!() macro_rules! makro
md module
md qualified
sc STATIC
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
md qualified tt Trait
ma makro!() macro_rules! makro
?? Unresolved
fn function() fn()
sc STATIC
un Union un Union
ev TupleV() TupleV(u32) ev TupleV() TupleV(u32)
ct CONST ?? Unresolved
"#]], "#]],
); );
} }
@ -221,38 +221,38 @@ fn complete_in_block() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw unsafe
kw fn
kw const
kw type
kw impl
kw extern
kw use
kw trait
kw static
kw mod
kw enum
kw struct
kw union
kw match
kw while
kw while let
kw loop
kw if
kw if let
kw for
kw true
kw false
kw let
kw return
sn pd
sn ppd
sn macro_rules
kw self
kw super
kw crate
fn foo() fn() fn foo() fn()
bt u32 bt u32
kw const
kw crate
kw enum
kw extern
kw false
kw fn
kw for
kw if
kw if let
kw impl
kw let
kw loop
kw match
kw mod
kw return
kw self
kw static
kw struct
kw super
kw trait
kw true
kw type
kw union
kw unsafe
kw use
kw while
kw while let
sn macro_rules
sn pd
sn ppd
"#]], "#]],
) )
} }
@ -267,40 +267,40 @@ fn complete_after_if_expr() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw unsafe
kw fn
kw const
kw type
kw impl
kw extern
kw use
kw trait
kw static
kw mod
kw enum
kw struct
kw union
kw match
kw while
kw while let
kw loop
kw if
kw if let
kw for
kw true
kw false
kw let
kw else
kw else if
kw return
sn pd
sn ppd
sn macro_rules
kw self
kw super
kw crate
fn foo() fn() fn foo() fn()
bt u32 bt u32
kw const
kw crate
kw else
kw else if
kw enum
kw extern
kw false
kw fn
kw for
kw if
kw if let
kw impl
kw let
kw loop
kw match
kw mod
kw return
kw self
kw static
kw struct
kw super
kw trait
kw true
kw type
kw union
kw unsafe
kw use
kw while
kw while let
sn macro_rules
sn pd
sn ppd
"#]], "#]],
) )
} }
@ -316,22 +316,22 @@ fn complete_in_match_arm() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw unsafe fn foo() fn()
kw match bt u32
kw while kw crate
kw while let kw false
kw loop kw for
kw if kw if
kw if let kw if let
kw for kw loop
kw true kw match
kw false
kw return kw return
kw self kw self
kw super kw super
kw crate kw true
fn foo() fn() kw unsafe
bt u32 kw while
kw while let
"#]], "#]],
) )
} }
@ -341,40 +341,40 @@ fn completes_in_loop_ctx() {
check_empty( check_empty(
r"fn my() { loop { $0 } }", r"fn my() { loop { $0 } }",
expect![[r#" expect![[r#"
kw unsafe
kw fn
kw const
kw type
kw impl
kw extern
kw use
kw trait
kw static
kw mod
kw enum
kw struct
kw union
kw match
kw while
kw while let
kw loop
kw if
kw if let
kw for
kw true
kw false
kw let
kw continue
kw break
kw return
sn pd
sn ppd
sn macro_rules
kw self
kw super
kw crate
fn my() fn() fn my() fn()
bt u32 bt u32
kw break
kw const
kw continue
kw crate
kw enum
kw extern
kw false
kw fn
kw for
kw if
kw if let
kw impl
kw let
kw loop
kw match
kw mod
kw return
kw self
kw static
kw struct
kw super
kw trait
kw true
kw type
kw union
kw unsafe
kw use
kw while
kw while let
sn macro_rules
sn pd
sn ppd
"#]], "#]],
); );
} }
@ -384,22 +384,22 @@ fn completes_in_let_initializer() {
check_empty( check_empty(
r#"fn main() { let _ = $0 }"#, r#"fn main() { let _ = $0 }"#,
expect![[r#" expect![[r#"
kw unsafe fn main() fn()
kw match bt u32
kw while kw crate
kw while let kw false
kw loop kw for
kw if kw if
kw if let kw if let
kw for kw loop
kw true kw match
kw false
kw return kw return
kw self kw self
kw super kw super
kw crate kw true
fn main() fn() kw unsafe
bt u32 kw while
kw while let
"#]], "#]],
) )
} }
@ -418,23 +418,23 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw unsafe fn foo() fn()
kw match st Foo
kw while bt u32
kw while let kw crate
kw loop kw false
kw for
kw if kw if
kw if let kw if let
kw for kw loop
kw true kw match
kw false
kw return kw return
kw self kw self
kw super kw super
kw crate kw true
st Foo kw unsafe
fn foo() fn() kw while
bt u32 kw while let
"#]], "#]],
); );
} }
@ -454,23 +454,23 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw unsafe fn foo() fn()
kw match lc bar i32
kw while bt u32
kw while let kw crate
kw loop kw false
kw for
kw if kw if
kw if let kw if let
kw for kw loop
kw true kw match
kw false
kw return kw return
kw self kw self
kw super kw super
kw crate kw true
lc bar i32 kw unsafe
fn foo() fn() kw while
bt u32 kw while let
"#]], "#]],
); );
} }
@ -485,24 +485,24 @@ fn quux(x: i32) {
} }
"#, "#,
expect![[r#" expect![[r#"
kw unsafe fn quux() fn(i32)
kw match lc x i32
kw while ma m!() macro_rules! m
kw while let bt u32
kw loop kw crate
kw false
kw for
kw if kw if
kw if let kw if let
kw for kw loop
kw true kw match
kw false
kw return kw return
kw self kw self
kw super kw super
kw crate kw true
bt u32 kw unsafe
lc x i32 kw while
fn quux() fn(i32) kw while let
ma m!() macro_rules! m
"#]], "#]],
); );
check_empty( check_empty(
@ -513,24 +513,24 @@ fn quux(x: i32) {
} }
", ",
expect![[r#" expect![[r#"
kw unsafe fn quux() fn(i32)
kw match lc x i32
kw while ma m!() macro_rules! m
kw while let bt u32
kw loop kw crate
kw false
kw for
kw if kw if
kw if let kw if let
kw for kw loop
kw true kw match
kw false
kw return kw return
kw self kw self
kw super kw super
kw crate kw true
bt u32 kw unsafe
lc x i32 kw while
fn quux() fn(i32) kw while let
ma m!() macro_rules! m
"#]], "#]],
); );
check_empty( check_empty(
@ -559,12 +559,12 @@ fn func() {
} }
"#, "#,
expect![[r#" expect![[r#"
ev TupleV() TupleV(u32)
ev RecordV {} RecordV { field: u32 }
ev UnitV UnitV
ct ASSOC_CONST const ASSOC_CONST: () ct ASSOC_CONST const ASSOC_CONST: ()
fn assoc_fn() fn() fn assoc_fn() fn()
ta AssocType type AssocType = () ta AssocType type AssocType = ()
ev RecordV {} RecordV { field: u32 }
ev TupleV() TupleV(u32)
ev UnitV UnitV
"#]], "#]],
); );
} }
@ -601,8 +601,8 @@ fn func() {
} }
"#, "#,
expect![[r#" expect![[r#"
ev Variant() Variant
fn variant fn() -> Enum fn variant fn() -> Enum
ev Variant() Variant
"#]], "#]],
); );
} }
@ -618,11 +618,11 @@ fn main() {
self::$0 self::$0
} }
", ",
expect![[r" expect![[r#"
tt Trait
fn main() fn()
fn foo() fn() -> impl Trait<U> fn foo() fn() -> impl Trait<U>
"]], fn main() fn()
tt Trait
"#]],
); );
} }
@ -638,12 +638,12 @@ fn main() {
self::$0 self::$0
} }
"#, "#,
expect![[r" expect![[r#"
tt Trait
fn main() fn()
fn bar() async fn() -> impl Trait<U> fn bar() async fn() -> impl Trait<U>
fn foo() async fn() -> u8 fn foo() async fn() -> u8
"]], fn main() fn()
tt Trait
"#]],
); );
} }

View file

@ -17,8 +17,8 @@ fn baz(file$0) {}
"#, "#,
expect![[r#" expect![[r#"
bn file_id: usize bn file_id: usize
kw ref
kw mut kw mut
kw ref
"#]], "#]],
); );
} }
@ -33,8 +33,8 @@ fn baz(foo: (), file$0) {}
"#, "#,
expect![[r#" expect![[r#"
bn file_id: usize bn file_id: usize
kw ref
kw mut kw mut
kw ref
"#]], "#]],
); );
} }
@ -49,8 +49,8 @@ fn baz(file$0 id: u32) {}
"#, "#,
expect![[r#" expect![[r#"
bn file_id: usize, bn file_id: usize,
kw ref
kw mut kw mut
kw ref
"#]], "#]],
); );
} }
@ -63,8 +63,8 @@ fn foo(file_id: usize) {}
fn bar(file_id: u32, $0) {} fn bar(file_id: u32, $0) {}
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut kw mut
kw ref
"#]], "#]],
); );
@ -73,10 +73,10 @@ fn bar(file_id: u32, $0) {}
fn f(#[foo = "bar"] baz: u32,) {} fn f(#[foo = "bar"] baz: u32,) {}
fn g(baz: (), ba$0) fn g(baz: (), ba$0)
"#, "#,
expect![[r##" expect![[r#"
kw ref
kw mut kw mut
"##]], kw ref
"#]],
) )
} }
@ -91,8 +91,8 @@ pub(crate) trait SourceRoot {
"#, "#,
expect![[r#" expect![[r#"
bn file_id: usize bn file_id: usize
kw ref
kw mut kw mut
kw ref
"#]], "#]],
); );
} }
@ -107,8 +107,8 @@ fn outer(text: &str) {
"#, "#,
expect![[r#" expect![[r#"
bn text: &str bn text: &str
kw ref
kw mut kw mut
kw ref
"#]], "#]],
) )
} }
@ -122,11 +122,11 @@ fn foo(Bar { bar }: Bar) {}
fn foo2($0) {} fn foo2($0) {}
"#, "#,
expect![[r#" expect![[r#"
bn Bar { bar }: Bar
kw ref
kw mut
bn Bar Bar { bar$1 }: Bar$0
st Bar st Bar
bn Bar Bar { bar$1 }: Bar$0
bn Bar { bar }: Bar
kw mut
kw ref
"#]], "#]],
) )
} }
@ -143,15 +143,15 @@ impl A {
} }
"#, "#,
expect![[r#" expect![[r#"
bn self
bn &self
bn mut self
bn &mut self
bn file_id: usize
kw ref
kw mut
sp Self sp Self
st A st A
bn &mut self
bn &self
bn file_id: usize
bn mut self
bn self
kw mut
kw ref
"#]], "#]],
) )
} }
@ -168,11 +168,11 @@ impl A {
} }
"#, "#,
expect![[r#" expect![[r#"
bn file_id: usize
kw ref
kw mut
sp Self sp Self
st A st A
bn file_id: usize
kw mut
kw ref
"#]], "#]],
) )
} }
@ -195,11 +195,11 @@ fn outer() {
} }
"#, "#,
expect![[r#" expect![[r#"
bn foo: i32
bn baz: i32
bn bar: i32 bn bar: i32
kw ref bn baz: i32
bn foo: i32
kw mut kw mut
kw ref
"#]], "#]],
) )
} }
@ -220,11 +220,11 @@ fn outer() {
} }
"#, "#,
expect![[r#" expect![[r#"
bn baz: i32
bn bar: i32 bn bar: i32
bn baz: i32
bn foo: i32 bn foo: i32
kw ref
kw mut kw mut
kw ref
"#]], "#]],
) )
} }
@ -238,8 +238,8 @@ fn bar(bar$0) {}
"#, "#,
expect![[r#" expect![[r#"
bn bar: u32 bn bar: u32
kw ref
kw mut kw mut
kw ref
"#]], "#]],
) )
} }

View file

@ -18,18 +18,18 @@ fn target_type_or_trait_in_impl_block() {
impl Tra$0 impl Tra$0
"#, "#,
expect![[r#" expect![[r#"
kw self
kw super
kw crate
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
kw crate
kw self
kw super
"#]], "#]],
) )
} }
@ -41,18 +41,18 @@ fn target_type_in_trait_impl_block() {
impl Trait for Str$0 impl Trait for Str$0
"#, "#,
expect![[r#" expect![[r#"
kw self
kw super
kw crate
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
kw crate
kw self
kw super
"#]], "#]],
) )
} }
@ -72,16 +72,16 @@ fn after_target_name_in_impl() {
check( check(
r"impl Trait $0", r"impl Trait $0",
expect![[r#" expect![[r#"
kw where
kw for kw for
kw where
"#]], "#]],
); );
// FIXME: This should not emit `kw for` // FIXME: This should not emit `kw for`
check( check(
r"impl Trait for Type $0", r"impl Trait for Type $0",
expect![[r#" expect![[r#"
kw where
kw for kw for
kw where
"#]], "#]],
); );
} }
@ -92,30 +92,30 @@ fn after_struct_name() {
check( check(
r"struct Struct $0", r"struct Struct $0",
expect![[r#" expect![[r#"
ma makro!() macro_rules! makro
md module
kw const
kw crate
kw enum
kw extern
kw fn
kw impl
kw mod
kw pub
kw pub(crate) kw pub(crate)
kw pub(super) kw pub(super)
kw pub
kw unsafe
kw fn
kw const
kw type
kw impl
kw extern
kw use
kw trait
kw static
kw mod
kw enum
kw struct
kw union
sn tmod (Test module)
sn tfn (Test function)
sn macro_rules
kw self kw self
kw static
kw struct
kw super kw super
kw crate kw trait
md module kw type
ma makro!() macro_rules! makro kw union
kw unsafe
kw use
sn macro_rules
sn tfn (Test function)
sn tmod (Test module)
"#]], "#]],
); );
} }
@ -126,30 +126,30 @@ fn after_fn_name() {
check( check(
r"fn func() $0", r"fn func() $0",
expect![[r#" expect![[r#"
ma makro!() macro_rules! makro
md module
kw const
kw crate
kw enum
kw extern
kw fn
kw impl
kw mod
kw pub
kw pub(crate) kw pub(crate)
kw pub(super) kw pub(super)
kw pub
kw unsafe
kw fn
kw const
kw type
kw impl
kw extern
kw use
kw trait
kw static
kw mod
kw enum
kw struct
kw union
sn tmod (Test module)
sn tfn (Test function)
sn macro_rules
kw self kw self
kw static
kw struct
kw super kw super
kw crate kw trait
md module kw type
ma makro!() macro_rules! makro kw union
kw unsafe
kw use
sn macro_rules
sn tfn (Test function)
sn tmod (Test module)
"#]], "#]],
); );
} }
@ -164,9 +164,9 @@ struct Foo {
} }
"#, "#,
expect![[r#" expect![[r#"
kw pub
kw pub(crate) kw pub(crate)
kw pub(super) kw pub(super)
kw pub
"#]], "#]],
) )
} }

View file

@ -13,29 +13,29 @@ fn in_mod_item_list() {
check( check(
r#"mod tests { $0 }"#, r#"mod tests { $0 }"#,
expect![[r#" expect![[r#"
ma makro!() macro_rules! makro
kw const
kw crate
kw enum
kw extern
kw fn
kw impl
kw mod
kw pub
kw pub(crate) kw pub(crate)
kw pub(super) kw pub(super)
kw pub
kw unsafe
kw fn
kw const
kw type
kw impl
kw extern
kw use
kw trait
kw static
kw mod
kw enum
kw struct
kw union
sn tmod (Test module)
sn tfn (Test function)
sn macro_rules
kw self kw self
kw static
kw struct
kw super kw super
kw crate kw trait
ma makro!() macro_rules! makro kw type
kw union
kw unsafe
kw use
sn macro_rules
sn tfn (Test function)
sn tmod (Test module)
"#]], "#]],
) )
} }
@ -45,30 +45,30 @@ fn in_source_file_item_list() {
check( check(
r#"$0"#, r#"$0"#,
expect![[r#" expect![[r#"
ma makro!() macro_rules! makro
md module
kw const
kw crate
kw enum
kw extern
kw fn
kw impl
kw mod
kw pub
kw pub(crate) kw pub(crate)
kw pub(super) kw pub(super)
kw pub
kw unsafe
kw fn
kw const
kw type
kw impl
kw extern
kw use
kw trait
kw static
kw mod
kw enum
kw struct
kw union
sn tmod (Test module)
sn tfn (Test function)
sn macro_rules
kw self kw self
kw static
kw struct
kw super kw super
kw crate kw trait
md module kw type
ma makro!() macro_rules! makro kw union
kw unsafe
kw use
sn macro_rules
sn tfn (Test function)
sn tmod (Test module)
"#]], "#]],
) )
} }
@ -78,25 +78,25 @@ fn in_item_list_after_attr() {
check( check(
r#"#[attr] $0"#, r#"#[attr] $0"#,
expect![[r#" expect![[r#"
kw const
kw enum
kw extern
kw fn
kw impl
kw mod
kw pub
kw pub(crate) kw pub(crate)
kw pub(super) kw pub(super)
kw pub
kw unsafe
kw fn
kw const
kw type
kw impl
kw extern
kw use
kw trait
kw static kw static
kw mod
kw enum
kw struct kw struct
kw trait
kw type
kw union kw union
sn tmod (Test module) kw unsafe
sn tfn (Test function) kw use
sn macro_rules sn macro_rules
sn tfn (Test function)
sn tmod (Test module)
"#]], "#]],
) )
} }
@ -107,8 +107,8 @@ fn in_qualified_path() {
check( check(
r#"crate::$0"#, r#"crate::$0"#,
expect![[r#" expect![[r#"
md module
ma makro!() macro_rules! makro ma makro!() macro_rules! makro
md module
"#]], "#]],
) )
} }
@ -119,8 +119,8 @@ fn after_unsafe_token() {
r#"unsafe $0"#, r#"unsafe $0"#,
expect![[r#" expect![[r#"
kw fn kw fn
kw trait
kw impl kw impl
kw trait
"#]], "#]],
); );
} }
@ -130,17 +130,17 @@ fn after_visibility() {
check( check(
r#"pub $0"#, r#"pub $0"#,
expect![[r#" expect![[r#"
kw unsafe
kw fn
kw const kw const
kw type
kw use
kw trait
kw static
kw mod
kw enum kw enum
kw fn
kw mod
kw static
kw struct kw struct
kw trait
kw type
kw union kw union
kw unsafe
kw use
"#]], "#]],
); );
} }
@ -152,8 +152,8 @@ fn after_visibility_unsafe() {
r#"pub unsafe $0"#, r#"pub unsafe $0"#,
expect![[r#" expect![[r#"
kw fn kw fn
kw trait
kw impl kw impl
kw trait
"#]], "#]],
); );
} }
@ -163,18 +163,18 @@ fn in_impl_assoc_item_list() {
check( check(
r#"impl Struct { $0 }"#, r#"impl Struct { $0 }"#,
expect![[r#" expect![[r#"
ma makro!() macro_rules! makro
md module
kw const
kw crate
kw fn
kw pub
kw pub(crate) kw pub(crate)
kw pub(super) kw pub(super)
kw pub
kw unsafe
kw fn
kw const
kw type
kw self kw self
kw super kw super
kw crate kw type
md module kw unsafe
ma makro!() macro_rules! makro
"#]], "#]],
) )
} }
@ -184,13 +184,13 @@ fn in_impl_assoc_item_list_after_attr() {
check( check(
r#"impl Struct { #[attr] $0 }"#, r#"impl Struct { #[attr] $0 }"#,
expect![[r#" expect![[r#"
kw const
kw fn
kw pub
kw pub(crate) kw pub(crate)
kw pub(super) kw pub(super)
kw pub
kw unsafe
kw fn
kw const
kw type kw type
kw unsafe
"#]], "#]],
) )
} }
@ -200,15 +200,15 @@ fn in_trait_assoc_item_list() {
check( check(
r"trait Foo { $0 }", r"trait Foo { $0 }",
expect![[r#" expect![[r#"
kw unsafe ma makro!() macro_rules! makro
kw fn md module
kw const kw const
kw type kw crate
kw fn
kw self kw self
kw super kw super
kw crate kw type
md module kw unsafe
ma makro!() macro_rules! makro
"#]], "#]],
); );
} }
@ -234,21 +234,21 @@ impl Test for () {
} }
"#, "#,
expect![[r#" expect![[r#"
kw pub(crate)
kw pub(super)
kw pub
kw unsafe
kw fn
kw const
kw type
ta type Type1 =
ct const CONST1: () = ct const CONST1: () =
fn fn function1() fn fn function1()
ma makro!() macro_rules! makro
md module
ta type Type1 =
kw const
kw crate
kw fn
kw pub
kw pub(crate)
kw pub(super)
kw self kw self
kw super kw super
kw crate kw type
md module kw unsafe
ma makro!() macro_rules! makro
"#]], "#]],
); );
} }

View file

@ -22,8 +22,8 @@ fn quux() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut kw mut
kw ref
"#]], "#]],
); );
} }
@ -113,19 +113,19 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut
en Enum
bn Record Record { field$1 }$0
st Record
bn Tuple Tuple($1)$0
st Tuple
md module
st Unit
ma makro!() macro_rules! makro
bn TupleV TupleV($1)$0
ev TupleV
ct CONST ct CONST
en Enum
ma makro!() macro_rules! makro
md module
st Record
st Tuple
st Unit
ev TupleV
bn Record Record { field$1 }$0
bn Tuple Tuple($1)$0
bn TupleV TupleV($1)$0
kw mut
kw ref
"#]], "#]],
); );
} }
@ -143,17 +143,17 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut
bn Record Record { field$1 }$0
st Record
bn Tuple Tuple($1)$0
st Tuple
ev Variant
md module
en SingleVariantEnum en SingleVariantEnum
st Unit
ma makro!() macro_rules! makro ma makro!() macro_rules! makro
md module
st Record
st Tuple
st Unit
ev Variant
bn Record Record { field$1 }$0
bn Tuple Tuple($1)$0
kw mut
kw ref
"#]], "#]],
); );
} }
@ -166,15 +166,15 @@ fn foo(a$0) {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut
bn Record Record { field$1 }: Record$0
st Record
bn Tuple Tuple($1): Tuple$0
st Tuple
md module
st Unit
ma makro!() macro_rules! makro ma makro!() macro_rules! makro
md module
st Record
st Tuple
st Unit
bn Record Record { field$1 }: Record$0
bn Tuple Tuple($1): Tuple$0
kw mut
kw ref
"#]], "#]],
); );
check( check(
@ -183,15 +183,15 @@ fn foo(a$0: Tuple) {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut
bn Record Record { field$1 }$0
st Record
bn Tuple Tuple($1)$0
st Tuple
md module
st Unit
ma makro!() macro_rules! makro ma makro!() macro_rules! makro
md module
st Record
st Tuple
st Unit
bn Record Record { field$1 }$0
bn Tuple Tuple($1)$0
kw mut
kw ref
"#]], "#]],
); );
} }
@ -210,9 +210,9 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut
ma m!() macro_rules! m ma m!() macro_rules! m
kw mut
kw ref
"#]], "#]],
); );
} }
@ -229,10 +229,10 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut
en E en E
ma m!() macro_rules! m ma m!() macro_rules! m
kw mut
kw ref
"#]], "#]],
); );
} }
@ -253,14 +253,14 @@ fn outer() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut
bn Record Record { field$1, .. }$0
st Record
bn Tuple Tuple($1, ..)$0
st Tuple
st Invisible
md foo md foo
st Invisible
st Record
st Tuple
bn Record Record { field$1, .. }$0
bn Tuple Tuple($1, ..)$0
kw mut
kw ref
"#]], "#]],
) )
} }
@ -279,12 +279,12 @@ impl Foo {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref
kw mut
bn Self Self($1)$0
sp Self sp Self
bn Foo Foo($1)$0
st Foo st Foo
bn Foo Foo($1)$0
bn Self Self($1)$0
kw mut
kw ref
"#]], "#]],
) )
} }
@ -303,10 +303,10 @@ fn func() {
} }
"#, "#,
expect![[r#" expect![[r#"
ev TupleV() TupleV(u32)
ev RecordV {} RecordV { field: u32 }
ev UnitV UnitV
ct ASSOC_CONST const ASSOC_CONST: () ct ASSOC_CONST const ASSOC_CONST: ()
ev RecordV {} RecordV { field: u32 }
ev TupleV() TupleV(u32)
ev UnitV UnitV
"#]], "#]],
); );
} }
@ -320,12 +320,12 @@ struct Bar(u32);
fn outer(Foo { bar: $0 }: Foo) {} fn outer(Foo { bar: $0 }: Foo) {}
"#, "#,
expect![[r#" expect![[r#"
kw ref st Bar
kw mut
bn Foo Foo { bar$1 }$0
st Foo st Foo
bn Bar Bar($1)$0 bn Bar Bar($1)$0
st Bar bn Foo Foo { bar$1 }$0
kw mut
kw ref
"#]], "#]],
) )
} }
@ -351,12 +351,12 @@ struct Bar(u32);
fn foo($0) {} fn foo($0) {}
"#, "#,
expect![[r#" expect![[r#"
kw ref st Bar
kw mut
bn Foo Foo { bar$1 }: Foo$0
st Foo st Foo
bn Bar Bar($1): Bar$0 bn Bar Bar($1): Bar$0
st Bar bn Foo Foo { bar$1 }: Foo$0
kw mut
kw ref
"#]], "#]],
) )
} }
@ -372,12 +372,12 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw ref st Bar
kw mut
bn Foo Foo { bar$1 }$0
st Foo st Foo
bn Bar Bar($1)$0 bn Bar Bar($1)$0
st Bar bn Foo Foo { bar$1 }$0
kw mut
kw ref
"#]], "#]],
) )
} }
@ -394,9 +394,9 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
"#]], "#]],
); );
check_empty( check_empty(
@ -409,13 +409,13 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
fn foo() fn()
st Foo
bt u32
kw crate
kw return kw return
kw self kw self
kw super kw super
kw crate
st Foo
fn foo() fn()
bt u32
"#]], "#]],
); );
check_empty( check_empty(

View file

@ -16,19 +16,19 @@ fn predicate_start() {
struct Foo<'lt, T, const C: usize> where $0 {} struct Foo<'lt, T, const C: usize> where $0 {}
"#, "#,
expect![[r#" expect![[r#"
kw self
kw super
kw crate
tt Trait
en Enum en Enum
st Record ma makro!() macro_rules! makro
st Tuple
md module md module
st Foo<> st Foo<>
st Record
st Tuple
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -40,12 +40,12 @@ fn bound_for_type_pred() {
struct Foo<'lt, T, const C: usize> where T: $0 {} struct Foo<'lt, T, const C: usize> where T: $0 {}
"#, "#,
expect![[r#" expect![[r#"
ma makro!() macro_rules! makro
md module
tt Trait
kw crate
kw self kw self
kw super kw super
kw crate
tt Trait
md module
ma makro!() macro_rules! makro
"#]], "#]],
); );
} }
@ -59,12 +59,12 @@ fn bound_for_lifetime_pred() {
struct Foo<'lt, T, const C: usize> where 'lt: $0 {} struct Foo<'lt, T, const C: usize> where 'lt: $0 {}
"#, "#,
expect![[r#" expect![[r#"
ma makro!() macro_rules! makro
md module
tt Trait
kw crate
kw self kw self
kw super kw super
kw crate
tt Trait
md module
ma makro!() macro_rules! makro
"#]], "#]],
); );
} }
@ -76,12 +76,12 @@ fn bound_for_for_pred() {
struct Foo<'lt, T, const C: usize> where for<'a> T: $0 {} struct Foo<'lt, T, const C: usize> where for<'a> T: $0 {}
"#, "#,
expect![[r#" expect![[r#"
ma makro!() macro_rules! makro
md module
tt Trait
kw crate
kw self kw self
kw super kw super
kw crate
tt Trait
md module
ma makro!() macro_rules! makro
"#]], "#]],
); );
} }
@ -93,19 +93,19 @@ fn param_list_for_for_pred() {
struct Foo<'lt, T, const C: usize> where for<'a> $0 {} struct Foo<'lt, T, const C: usize> where for<'a> $0 {}
"#, "#,
expect![[r#" expect![[r#"
kw self
kw super
kw crate
tt Trait
en Enum en Enum
st Record ma makro!() macro_rules! makro
st Tuple
md module md module
st Foo<> st Foo<>
st Record
st Tuple
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -119,19 +119,19 @@ impl Record {
} }
"#, "#,
expect![[r#" expect![[r#"
kw self
kw super
kw crate
sp Self
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
sp Self
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
kw crate
kw self
kw super
"#]], "#]],
); );
} }

View file

@ -25,15 +25,15 @@ fn main() {
"#, "#,
expect![[r#" expect![[r#"
me foo() fn(&self) me foo() fn(&self)
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr) sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr) sn dbg dbg!(expr)
sn dbgr dbg!(&expr) sn dbgr dbg!(&expr)
sn call function(expr)
sn let let sn let let
sn letm let mut sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]], "#]],
) )
} }
@ -55,15 +55,15 @@ fn main() {
"#, "#,
expect![[r#" expect![[r#"
me foo() fn(&self) me foo() fn(&self)
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr) sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr) sn dbg dbg!(expr)
sn dbgr dbg!(&expr) sn dbgr dbg!(&expr)
sn call function(expr)
sn let let sn let let
sn letm let mut sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]], "#]],
) )
} }
@ -87,15 +87,15 @@ fn main() {}
"#, "#,
expect![[r#" expect![[r#"
me foo() fn(&self) me foo() fn(&self)
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr) sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr) sn dbg dbg!(expr)
sn dbgr dbg!(&expr) sn dbgr dbg!(&expr)
sn call function(expr)
sn let let sn let let
sn letm let mut sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]], "#]],
) )
} }
@ -119,15 +119,15 @@ fn main() {}
"#, "#,
expect![[r#" expect![[r#"
me foo() fn(&self) me foo() fn(&self)
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr) sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr) sn dbg dbg!(expr)
sn dbgr dbg!(&expr) sn dbgr dbg!(&expr)
sn call function(expr)
sn let let sn let let
sn letm let mut sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]], "#]],
) )
} }

View file

@ -155,32 +155,32 @@ fn main() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw unsafe
kw match
kw while
kw while let
kw loop
kw if
kw if let
kw for
kw true
kw false
kw return
st Foo {} Foo { foo1: u32, foo2: u32 }
fd ..Default::default() fd ..Default::default()
fd foo1 u32 fd foo1 u32
fd foo2 u32 fd foo2 u32
kw self fn main() fn()
kw super
kw crate
lc foo Foo lc foo Foo
lc thing i32 lc thing i32
st Foo
fn main() fn()
md core md core
bt u32 st Foo
tt Sized st Foo {} Foo { foo1: u32, foo2: u32 }
tt Default tt Default
tt Sized
bt u32
kw crate
kw false
kw for
kw if
kw if let
kw loop
kw match
kw return
kw self
kw super
kw true
kw unsafe
kw while
kw while let
"#]], "#]],
); );
check( check(
@ -198,9 +198,9 @@ fn main() {
} }
"#, "#,
expect![[r#" expect![[r#"
fn default() (as Default) fn() -> Self
fd foo1 u32 fd foo1 u32
fd foo2 u32 fd foo2 u32
fn default() (as Default) fn() -> Self
"#]], "#]],
); );
} }
@ -218,8 +218,8 @@ fn foo() {
} }
"#, "#,
expect![[r#" expect![[r#"
fd foo u32
fd bar f32 fd bar f32
fd foo u32
"#]], "#]],
) )
} }

View file

@ -17,21 +17,21 @@ struct Foo<'lt, T, const C: usize> {
} }
"#, "#,
expect![[r#" expect![[r#"
kw self
kw super
kw crate
sp Self
tp T
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
sp Self
st Foo<>
st Record st Record
st Tuple st Tuple
md module
st Foo<>
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
tp T
un Union un Union
bt u32 bt u32
kw crate
kw self
kw super
"#]], "#]],
) )
} }
@ -43,24 +43,24 @@ fn tuple_struct_field() {
struct Foo<'lt, T, const C: usize>(f$0); struct Foo<'lt, T, const C: usize>(f$0);
"#, "#,
expect![[r#" expect![[r#"
kw pub(crate)
kw pub(super)
kw pub
kw self
kw super
kw crate
sp Self
tp T
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
sp Self
st Foo<>
st Record st Record
st Tuple st Tuple
md module
st Foo<>
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
tp T
un Union un Union
bt u32 bt u32
kw crate
kw pub
kw pub(crate)
kw pub(super)
kw self
kw super
"#]], "#]],
) )
} }
@ -72,19 +72,19 @@ fn fn_return_type() {
fn x<'lt, T, const C: usize>() -> $0 fn x<'lt, T, const C: usize>() -> $0
"#, "#,
expect![[r#" expect![[r#"
kw self
kw super
kw crate
tp T
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
tp T
un Union un Union
bt u32 bt u32
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -97,20 +97,20 @@ struct Foo<T>(T);
const FOO: $0 = Foo(2); const FOO: $0 = Foo(2);
"#, "#,
expect![[r#" expect![[r#"
it Foo<i32>
kw self
kw super
kw crate
tt Trait
en Enum en Enum
st Record ma makro!() macro_rules! makro
st Tuple
md module md module
st Foo<> st Foo<>
st Record
st Tuple
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
it Foo<i32>
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -125,19 +125,19 @@ fn f2() {
} }
"#, "#,
expect![[r#" expect![[r#"
it i32
kw self
kw super
kw crate
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
it i32
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -154,19 +154,19 @@ fn f2() {
} }
"#, "#,
expect![[r#" expect![[r#"
it u64
kw self
kw super
kw crate
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
it u64
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -180,19 +180,19 @@ fn f2(x: u64) -> $0 {
} }
"#, "#,
expect![[r#" expect![[r#"
it u64
kw self
kw super
kw crate
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
it u64
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -207,19 +207,19 @@ fn f2(x: $0) {
} }
"#, "#,
expect![[r#" expect![[r#"
it i32
kw self
kw super
kw crate
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
bt u32 bt u32
it i32
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -240,21 +240,21 @@ fn foo<'lt, T, const C: usize>() {
} }
"#, "#,
expect![[r#" expect![[r#"
it a::Foo<a::Foo<i32>>
kw self
kw super
kw crate
tp T
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md a
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
tp T
un Union un Union
md a
bt u32 bt u32
it a::Foo<a::Foo<i32>>
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -270,21 +270,21 @@ fn foo<'lt, T, const C: usize>() {
} }
"#, "#,
expect![[r#" expect![[r#"
it Foo<i32>
kw self
kw super
kw crate
tp T
tt Trait
en Enum en Enum
st Record ma makro!() macro_rules! makro
st Tuple
md module md module
st Foo<> st Foo<>
st Record
st Tuple
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
tp T
un Union un Union
bt u32 bt u32
it Foo<i32>
kw crate
kw self
kw super
"#]], "#]],
); );
} }
@ -299,19 +299,19 @@ fn foo<'lt, T, const C: usize>() {
} }
"#, "#,
expect![[r#" expect![[r#"
kw self
kw super
kw crate
tp T
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
tp T
un Union un Union
bt u32 bt u32
kw crate
kw self
kw super
"#]], "#]],
); );
check( check(
@ -322,13 +322,13 @@ fn foo<'lt, T, const C: usize>() {
} }
"#, "#,
expect![[r#" expect![[r#"
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
un Union un Union
"#]], "#]],
); );
@ -345,23 +345,23 @@ trait Trait2 {
fn foo<'lt, T: Trait2<$0>, const CONST_PARAM: usize>(_: T) {} fn foo<'lt, T: Trait2<$0>, const CONST_PARAM: usize>(_: T) {}
"#, "#,
expect![[r#" expect![[r#"
kw self ct CONST
kw super
kw crate
ta Foo = (as Trait2) type Foo
tp T
cp CONST_PARAM cp CONST_PARAM
tt Trait
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
tt Trait2 tt Trait2
ta Foo = (as Trait2) type Foo
tp T
un Union un Union
ct CONST
bt u32 bt u32
kw crate
kw self
kw super
"#]], "#]],
); );
check( check(
@ -373,16 +373,16 @@ trait Trait2 {
fn foo<'lt, T: Trait2<self::$0>, const CONST_PARAM: usize>(_: T) {} fn foo<'lt, T: Trait2<self::$0>, const CONST_PARAM: usize>(_: T) {}
"#, "#,
expect![[r#" expect![[r#"
tt Trait ct CONST
en Enum en Enum
ma makro!() macro_rules! makro
md module
st Record st Record
st Tuple st Tuple
md module
st Unit st Unit
ma makro!() macro_rules! makro tt Trait
tt Trait2 tt Trait2
un Union un Union
ct CONST
"#]], "#]],
); );
} }

View file

@ -24,9 +24,9 @@ mod foo {}
expect![[r#" expect![[r#"
md foo md foo
md other_crate md other_crate
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
"#]], "#]],
); );
} }
@ -60,8 +60,8 @@ mod foo { pub struct S; }
use self::{foo::*, bar$0}; use self::{foo::*, bar$0};
"#, "#,
expect![[r#" expect![[r#"
st S
md foo md foo
st S
"#]], "#]],
); );
} }
@ -91,8 +91,8 @@ mod foo {
use foo::{$0} use foo::{$0}
"#, "#,
expect![[r#" expect![[r#"
kw self
md bar md bar
kw self
"#]], "#]],
); );
} }
@ -126,8 +126,8 @@ mod foo {
use foo::{bar::{$0}} use foo::{bar::{$0}}
"#, "#,
expect![[r#" expect![[r#"
kw self
md baz md baz
kw self
"#]], "#]],
); );
} }
@ -147,8 +147,8 @@ mod foo {
struct Bar; struct Bar;
"#, "#,
expect![[r#" expect![[r#"
st Foo
ma foo macro_rules! foo_ ma foo macro_rules! foo_
st Foo
"#]], "#]],
); );
} }
@ -200,10 +200,10 @@ mod foo {}
struct Bar; struct Bar;
"#, "#,
expect![[r#" expect![[r#"
kw super::
st Bar
md bar md bar
md foo md foo
st Bar
kw super::
"#]], "#]],
); );
} }
@ -221,9 +221,9 @@ mod a {
} }
"#, "#,
expect![[r#" expect![[r#"
kw super::
md b
ct A ct A
md b
kw super::
"#]], "#]],
); );
} }
@ -255,8 +255,8 @@ pub struct Foo;
pub mod foo {} pub mod foo {}
"#, "#,
expect![[r#" expect![[r#"
st Foo
md foo md foo
st Foo
"#]], "#]],
); );
} }
@ -271,9 +271,9 @@ pub use $0;
"#, "#,
expect![[r#" expect![[r#"
md bar md bar
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
"#]], "#]],
); );
} }
@ -288,9 +288,9 @@ use {$0};
"#, "#,
expect![[r#" expect![[r#"
md bar md bar
kw crate::
kw self:: kw self::
kw super:: kw super::
kw crate::
"#]], "#]],
); );
} }

View file

@ -16,10 +16,10 @@ fn empty_pub() {
pub($0) pub($0)
"#, "#,
expect![[r#" expect![[r#"
kw crate
kw in kw in
kw self kw self
kw super kw super
kw crate
"#]], "#]],
); );
} }
@ -31,9 +31,9 @@ fn after_in_kw() {
pub(in $0) pub(in $0)
"#, "#,
expect![[r#" expect![[r#"
kw crate
kw self kw self
kw super kw super
kw crate
"#]], "#]],
); );
} }