Skip to content

Wrong gray-color type position in variable definitions on generic this function #14833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
enomado opened this issue May 18, 2023 · 2 comments
Closed
Labels
C-bug Category: bug

Comments

@enomado
Copy link
Contributor

enomado commented May 18, 2023

I guess it should be
let mut acc :T = start
but result is
let mut :T acc = start

pub fn accumulate_vec_inplace<'a, T>(arr: &mut Vec<T>, start: T)
where
    T: Zero,
    T: Add<T>,
    T: Clone,
{
    let mut acc = start;
    for x in arr {
        acc = acc + x.clone();
        *x = acc.clone();
    }
}

Screenshot_2023-05-18_04-31-26

@enomado enomado added the C-bug Category: bug label May 18, 2023
@enomado
Copy link
Contributor Author

enomado commented May 18, 2023

rust-analyzer
v0.4.1518
Pre-Release

@Veykril
Copy link
Member

Veykril commented May 18, 2023

Fixed by #14818

@Veykril Veykril closed this as completed May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants