mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Fix #2705
The `-` turned into a `+` during a refactoring. The original issue was caused by `Read` resolving wrongly to a trait without type parameters instead of a struct with one parameter; this only fixes the crash, not the wrong resolution.
This commit is contained in:
parent
15d94cbffc
commit
67240c8d91
2 changed files with 18 additions and 1 deletions
|
@ -331,7 +331,7 @@ pub(super) fn substs_from_path_segment(
|
|||
if let Some(generic_args) = &segment.args_and_bindings {
|
||||
// if args are provided, it should be all of them, but we can't rely on that
|
||||
let self_param_correction = if add_self_param { 1 } else { 0 };
|
||||
let child_len = child_len + self_param_correction;
|
||||
let child_len = child_len - self_param_correction;
|
||||
for arg in generic_args.args.iter().take(child_len) {
|
||||
match arg {
|
||||
GenericArg::Type(type_ref) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue