diff options
| author | Young-Flash <dongyang@apache.org> | 2024-02-18 15:29:45 +0800 |
|---|---|---|
| committer | Young-Flash <dongyang@apache.org> | 2024-02-21 10:57:39 +0800 |
| commit | 00358b1fe078bc4d702375203f79b088d2b9a5f6 (patch) | |
| tree | 1fffde73a5603b9169473b028fa5ed5fe4d1ebad | |
| parent | dba167592ee67748d2f24c8f646cbe193c95da14 (diff) | |
| download | rust-00358b1fe078bc4d702375203f79b088d2b9a5f6.tar.gz rust-00358b1fe078bc4d702375203f79b088d2b9a5f6.zip | |
rebase on lastest master
| -rw-r--r-- | crates/hir/src/display.rs | 5 | ||||
| -rw-r--r-- | crates/ide/src/hover/tests.rs | 24 |
2 files changed, 13 insertions, 16 deletions
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs index d76eb873bf4..010c3537574 100644 --- a/crates/hir/src/display.rs +++ b/crates/hir/src/display.rs @@ -17,10 +17,7 @@ use hir_ty::{ }; use crate::{ - Adt, AsAssocItem, AssocItemContainer, Const, ConstParam, Enum, ExternCrateDecl, Field, - Function, GenericParam, HasCrate, HasVisibility, LifetimeParam, Macro, Module, SelfParam, - Static, Struct, Trait, TraitAlias, TupleField, TyBuilder, Type, TypeAlias, TypeOrConstParam, - TypeParam, Union, Variant, + Adt, AsAssocItem, AssocItem, AssocItemContainer, Const, ConstParam, Enum, ExternCrateDecl, Field, Function, GenericParam, HasCrate, HasVisibility, LifetimeParam, Macro, Module, SelfParam, Static, Struct, Trait, TraitAlias, TupleField, TyBuilder, Type, TypeAlias, TypeOrConstParam, TypeParam, Union, Variant }; impl HirDisplay for Function { diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs index 73d9339a229..e845ef66894 100644 --- a/crates/ide/src/hover/tests.rs +++ b/crates/ide/src/hover/tests.rs @@ -411,7 +411,7 @@ fn main() { name: "FnOnce", kind: Trait, container_name: "function", - description: "pub trait FnOnce<Args>\nwhere\n Args: Tuple,", + description: "pub trait FnOnce<Args>\nwhere\n Args: Tuple, {\n pub type Output,\n pub extern \"rust-call\" fn call_once(self, args: Args) -> Self::Output,\n}", }, }, ], @@ -2766,7 +2766,7 @@ fn main() { let s$0t = foo(); } focus_range: 19..22, name: "Bar", kind: Trait, - description: "trait Bar", + description: "trait Bar {}", }, }, HoverGotoTypeData { @@ -2779,7 +2779,7 @@ fn main() { let s$0t = foo(); } focus_range: 6..9, name: "Foo", kind: Trait, - description: "trait Foo", + description: "trait Foo {}", }, }, ], @@ -2816,7 +2816,7 @@ fn main() { let s$0t = foo(); } focus_range: 22..25, name: "Bar", kind: Trait, - description: "trait Bar<T>", + description: "trait Bar<T> {}", }, }, HoverGotoTypeData { @@ -2829,7 +2829,7 @@ fn main() { let s$0t = foo(); } focus_range: 6..9, name: "Foo", kind: Trait, - description: "trait Foo<T>", + description: "trait Foo<T> {}", }, }, HoverGotoTypeData { @@ -2920,7 +2920,7 @@ fn foo(ar$0g: &impl Foo + Bar<S>) {} focus_range: 19..22, name: "Bar", kind: Trait, - description: "trait Bar<T>", + description: "trait Bar<T> {}", }, }, HoverGotoTypeData { @@ -2933,7 +2933,7 @@ fn foo(ar$0g: &impl Foo + Bar<S>) {} focus_range: 6..9, name: "Foo", kind: Trait, - description: "trait Foo", + description: "trait Foo {}", }, }, HoverGotoTypeData { @@ -3220,7 +3220,7 @@ fn foo(a$0rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {} focus_range: 28..36, name: "DynTrait", kind: Trait, - description: "trait DynTrait<T>", + description: "trait DynTrait<T> {}", }, }, HoverGotoTypeData { @@ -3233,7 +3233,7 @@ fn foo(a$0rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {} focus_range: 6..15, name: "ImplTrait", kind: Trait, - description: "trait ImplTrait<T>", + description: "trait ImplTrait<T> {}", }, }, HoverGotoTypeData { @@ -7456,7 +7456,7 @@ impl Iterator for S { name: "Future", kind: Trait, container_name: "future", - description: "pub trait Future", + description: "pub trait Future {\n pub type Output,\n pub fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>,\n}", }, }, HoverGotoTypeData { @@ -7470,7 +7470,7 @@ impl Iterator for S { name: "Iterator", kind: Trait, container_name: "iterator", - description: "pub trait Iterator", + description: "pub trait Iterator {\n pub type Item,\n pub fn next(&mut self) -> Option<Self::Item>,\n pub fn nth(&mut self, n: usize) -> Option<Self::Item>,\n pub fn by_ref(&mut self) -> &mut Self\nwhere\n Self: Sized,,\n}", }, }, HoverGotoTypeData { @@ -7483,7 +7483,7 @@ impl Iterator for S { focus_range: 49..56, name: "Notable", kind: Trait, - description: "trait Notable", + description: "trait Notable {}", }, }, HoverGotoTypeData { |
