mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Fix type parameter defaults
They should not be applied in expression or pattern contexts, unless there are other explicitly given type args.
This commit is contained in:
parent
02f7b5d7ab
commit
a4a4a1854e
10 changed files with 192 additions and 115 deletions
|
@ -29,7 +29,7 @@ fn omit_default_type_parameters() {
|
|||
//- /main.rs
|
||||
struct Foo<T = u8> { t: T }
|
||||
fn main() {
|
||||
let foo = Foo { t: 5 };
|
||||
let foo = Foo { t: 5u8 };
|
||||
foo<|>;
|
||||
}
|
||||
",
|
||||
|
@ -41,7 +41,7 @@ fn omit_default_type_parameters() {
|
|||
//- /main.rs
|
||||
struct Foo<K, T = u8> { k: K, t: T }
|
||||
fn main() {
|
||||
let foo = Foo { k: 400, t: 5 };
|
||||
let foo = Foo { k: 400, t: 5u8 };
|
||||
foo<|>;
|
||||
}
|
||||
",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue