mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Fix tests.
This commit is contained in:
parent
5f2486e9a8
commit
0f6621fbfa
6 changed files with 355 additions and 336 deletions
|
@ -1189,7 +1189,9 @@ fn main() {
|
|||
#[test]
|
||||
fn hover_for_param_with_multiple_traits() {
|
||||
check(
|
||||
r#"trait Deref {
|
||||
r#"
|
||||
//- minicore: sized
|
||||
trait Deref {
|
||||
type Target: ?Sized;
|
||||
}
|
||||
trait DerefMut {
|
||||
|
@ -3380,17 +3382,17 @@ fn foo() {
|
|||
fn hover_type_param() {
|
||||
check(
|
||||
r#"
|
||||
//- minicore: sized
|
||||
struct Foo<T>(T);
|
||||
trait Copy {}
|
||||
trait Clone {}
|
||||
trait Sized {}
|
||||
impl<T: Copy + Clone> Foo<T$0> where T: Sized {}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*T*
|
||||
|
||||
```rust
|
||||
T: Copy + Clone + Sized
|
||||
T: Copy + Clone
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
|
@ -3423,6 +3425,26 @@ impl<T: 'static> Foo<T$0> {}
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_type_param_not_sized() {
|
||||
check(
|
||||
r#"
|
||||
//- minicore: sized
|
||||
struct Foo<T>(T);
|
||||
trait Copy {}
|
||||
trait Clone {}
|
||||
impl<T: Copy + Clone> Foo<T$0> where T: ?Sized {}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*T*
|
||||
|
||||
```rust
|
||||
T: Copy + Clone + ?Sized
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_const_param() {
|
||||
check(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue