Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Inlay hints is giving wrong hints for recursive functions #420

Open
SeanningTatum opened this issue Sep 2, 2023 · 1 comment
Open

Inlay hints is giving wrong hints for recursive functions #420

SeanningTatum opened this issue Sep 2, 2023 · 1 comment

Comments

@SeanningTatum
Copy link

Problem

Inlay hints is not giving proper hints for recursive functions

Actual

fn quick_sort(array: &mut Vec<i64>, low: usize, high: usize)  {
        let pivot = partition(array, low, high); => usize
        quick_sort(array, low, pivot.checked_sub(1).unwrap_or(0)); <- (high, default)
        quick_sort(array, pivot + 1, high); <- (low)
}

Expected

fn quick_sort(array: &mut Vec<i64>, low: usize, high: usize)  {
        let pivot = partition(array, low, high); => usize
        quick_sort(array, low, pivot.checked_sub(1).unwrap_or(0)); <- (array, low, high)
        quick_sort(array, pivot + 1, high); <- (array, low, high)
}

Attachments

image

@SeanningTatum SeanningTatum changed the title Inlay hints giving wrong hints for recursive functions Inlay hints is giving wrong hints for recursive functions Sep 6, 2023
@mrcjkb
Copy link

mrcjkb commented Oct 13, 2023

This looks like a rust_analyzer bug.

Maybe related to rust-lang/rust-analyzer#15167?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants