mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix: Resolve generic parameters within use captures
This commit is contained in:
parent
7f39ee3fce
commit
d6b62265b5
5 changed files with 90 additions and 2 deletions
|
@ -3102,6 +3102,75 @@ fn main() { let _: S; }
|
|||
r#"
|
||||
use lib::S as Baz;
|
||||
fn main() { let _: Baz; }
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rename_type_param_ref_in_use_bound() {
|
||||
check(
|
||||
"U",
|
||||
r#"
|
||||
fn foo<T>() -> impl use<T$0> Trait {}
|
||||
"#,
|
||||
r#"
|
||||
fn foo<U>() -> impl use<U> Trait {}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rename_type_param_in_use_bound() {
|
||||
check(
|
||||
"U",
|
||||
r#"
|
||||
fn foo<T$0>() -> impl use<T> Trait {}
|
||||
"#,
|
||||
r#"
|
||||
fn foo<U>() -> impl use<U> Trait {}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rename_lifetime_param_ref_in_use_bound() {
|
||||
check(
|
||||
"u",
|
||||
r#"
|
||||
fn foo<'t>() -> impl use<'t$0> Trait {}
|
||||
"#,
|
||||
r#"
|
||||
fn foo<'u>() -> impl use<'u> Trait {}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rename_lifetime_param_in_use_bound() {
|
||||
check(
|
||||
"u",
|
||||
r#"
|
||||
fn foo<'t$0>() -> impl use<'t> Trait {}
|
||||
"#,
|
||||
r#"
|
||||
fn foo<'u>() -> impl use<'u> Trait {}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rename_parent_type_param_in_use_bound() {
|
||||
check(
|
||||
"U",
|
||||
r#"
|
||||
trait Trait<T> {
|
||||
fn foo() -> impl use<T$0> Trait {}
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
trait Trait<U> {
|
||||
fn foo() -> impl use<U> Trait {}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue