mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Update tests
This commit is contained in:
parent
73fc05fdca
commit
455b418263
@ -653,7 +653,9 @@ fn main() { let foo_test = fo$0o(); }
|
|||||||
```
|
```
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
pub fn foo<'a, T: AsRef<str>>(b: &'a T) -> &'a str
|
pub fn foo<'a, T>(b: &'a T) -> &'a str
|
||||||
|
where
|
||||||
|
T: AsRef<str>,
|
||||||
```
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
@ -861,7 +863,7 @@ fn main() { So$0me(12); }
|
|||||||
```
|
```
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
Some
|
Some(T)
|
||||||
```
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
@ -927,7 +929,7 @@ fn main() {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
Some
|
Some(T)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1424,13 +1426,14 @@ fn bar() { fo$0o(); }
|
|||||||
```
|
```
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
// Top level `pub(crate)` will be displayed as no visibility.
|
||||||
check(
|
check(
|
||||||
r#"pub(crate) async unsafe extern "C" fn foo$0() {}"#,
|
r#"mod m { pub(crate) async unsafe extern "C" fn foo$0() {} }"#,
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
test
|
test::m
|
||||||
```
|
```
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -1472,11 +1475,18 @@ extern crate st$0d;
|
|||||||
//! abc123
|
//! abc123
|
||||||
"#,
|
"#,
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*std*
|
*std*
|
||||||
Standard library for this test
|
|
||||||
|
|
||||||
Printed?
|
```rust
|
||||||
abc123
|
extern crate std
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Standard library for this test
|
||||||
|
|
||||||
|
Printed?
|
||||||
|
abc123
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
check(
|
check(
|
||||||
@ -1490,11 +1500,18 @@ extern crate std as ab$0c;
|
|||||||
//! abc123
|
//! abc123
|
||||||
"#,
|
"#,
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*abc*
|
*abc*
|
||||||
Standard library for this test
|
|
||||||
|
|
||||||
Printed?
|
```rust
|
||||||
abc123
|
extern crate std
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Standard library for this test
|
||||||
|
|
||||||
|
Printed?
|
||||||
|
abc123
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -2004,7 +2021,7 @@ enum E {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
V
|
V { field: i32 }
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -2400,7 +2417,7 @@ fn main() { let s$0t = S{ f1:Arg(0) }; }
|
|||||||
focus_range: 24..25,
|
focus_range: 24..25,
|
||||||
name: "S",
|
name: "S",
|
||||||
kind: Struct,
|
kind: Struct,
|
||||||
description: "struct S",
|
description: "struct S<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -2446,7 +2463,7 @@ fn main() { let s$0t = S{ f1: S{ f1: Arg(0) } }; }
|
|||||||
focus_range: 24..25,
|
focus_range: 24..25,
|
||||||
name: "S",
|
name: "S",
|
||||||
kind: Struct,
|
kind: Struct,
|
||||||
description: "struct S",
|
description: "struct S<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -2588,7 +2605,7 @@ fn main() { let s$0t = foo(); }
|
|||||||
focus_range: 6..9,
|
focus_range: 6..9,
|
||||||
name: "Foo",
|
name: "Foo",
|
||||||
kind: Trait,
|
kind: Trait,
|
||||||
description: "trait Foo",
|
description: "trait Foo<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -2685,7 +2702,7 @@ fn main() { let s$0t = foo(); }
|
|||||||
focus_range: 6..9,
|
focus_range: 6..9,
|
||||||
name: "Foo",
|
name: "Foo",
|
||||||
kind: Trait,
|
kind: Trait,
|
||||||
description: "trait Foo",
|
description: "trait Foo<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -2698,7 +2715,7 @@ fn main() { let s$0t = foo(); }
|
|||||||
focus_range: 22..25,
|
focus_range: 22..25,
|
||||||
name: "Bar",
|
name: "Bar",
|
||||||
kind: Trait,
|
kind: Trait,
|
||||||
description: "trait Bar",
|
description: "trait Bar<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -2802,7 +2819,7 @@ fn foo(ar$0g: &impl Foo + Bar<S>) {}
|
|||||||
focus_range: 19..22,
|
focus_range: 19..22,
|
||||||
name: "Bar",
|
name: "Bar",
|
||||||
kind: Trait,
|
kind: Trait,
|
||||||
description: "trait Bar",
|
description: "trait Bar<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -2899,7 +2916,7 @@ fn foo(ar$0g: &impl Foo<S>) {}
|
|||||||
focus_range: 6..9,
|
focus_range: 6..9,
|
||||||
name: "Foo",
|
name: "Foo",
|
||||||
kind: Trait,
|
kind: Trait,
|
||||||
description: "trait Foo",
|
description: "trait Foo<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -2949,7 +2966,7 @@ fn main() { let s$0t = foo(); }
|
|||||||
focus_range: 49..50,
|
focus_range: 49..50,
|
||||||
name: "B",
|
name: "B",
|
||||||
kind: Struct,
|
kind: Struct,
|
||||||
description: "struct B",
|
description: "struct B<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -3025,7 +3042,7 @@ fn foo(ar$0g: &dyn Foo<S>) {}
|
|||||||
focus_range: 6..9,
|
focus_range: 6..9,
|
||||||
name: "Foo",
|
name: "Foo",
|
||||||
kind: Trait,
|
kind: Trait,
|
||||||
description: "trait Foo",
|
description: "trait Foo<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -3073,7 +3090,7 @@ fn foo(a$0rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {}
|
|||||||
focus_range: 6..15,
|
focus_range: 6..15,
|
||||||
name: "ImplTrait",
|
name: "ImplTrait",
|
||||||
kind: Trait,
|
kind: Trait,
|
||||||
description: "trait ImplTrait",
|
description: "trait ImplTrait<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -3086,7 +3103,7 @@ fn foo(a$0rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {}
|
|||||||
focus_range: 50..51,
|
focus_range: 50..51,
|
||||||
name: "B",
|
name: "B",
|
||||||
kind: Struct,
|
kind: Struct,
|
||||||
description: "struct B",
|
description: "struct B<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -3099,7 +3116,7 @@ fn foo(a$0rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {}
|
|||||||
focus_range: 28..36,
|
focus_range: 28..36,
|
||||||
name: "DynTrait",
|
name: "DynTrait",
|
||||||
kind: Trait,
|
kind: Trait,
|
||||||
description: "trait DynTrait",
|
description: "trait DynTrait<T>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
@ -3565,6 +3582,17 @@ mod foo$0;
|
|||||||
"#,
|
"#,
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
*foo*
|
*foo*
|
||||||
|
|
||||||
|
```rust
|
||||||
|
test
|
||||||
|
```
|
||||||
|
|
||||||
|
```rust
|
||||||
|
mod foo
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
For the horde!
|
For the horde!
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
@ -3589,7 +3617,7 @@ use foo::bar::{self$0};
|
|||||||
```
|
```
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
pub mod bar
|
mod bar
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -3670,8 +3698,9 @@ fn main() {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
fn bar<'t, T: Clone + 't>(s: &mut S<'t, T>, t: u32) -> *mut u32
|
fn bar<'t, T>(s: &mut S<'t, T>, t: u32) -> *mut u32
|
||||||
where
|
where
|
||||||
|
T: Clone + 't,
|
||||||
't: 't + 't,
|
't: 't + 't,
|
||||||
for<'a> T: Clone + 'a,
|
for<'a> T: Clone + 'a,
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user