hax icon indicating copy to clipboard operation
hax copied to clipboard

Incorrect order for Deps.sort

Open cmester0 opened this issue 2 years ago • 4 comments

The following piece of code

pub trait Foo {
    const c : u32;
}

pub struct foo {}
impl Foo for foo {
    const c : u32 = 17;
}

type F = foo;

pub fn bar(random: u32) -> u32 {
    random % F::c
}

gets sorted incorrectly, as the bar function is moved before the impl block. If possible we should probably keep the order of the original program instead of moving functions earlier, if there are no conflicts in the dependency graph.

cmester0 avatar Nov 27 '23 10:11 cmester0

This issue is related to #375 as the graph is not getting an edge, since the concrete idents are not equal.

cmester0 avatar Nov 27 '23 10:11 cmester0

Hi Lasse, thanks for the bug report! That's indeed related to #375, and also to #372, which I have to debug. Gonna try to look at that soon.

W95Psp avatar Dec 06 '23 13:12 W95Psp

Hey, this should be fixed now, impl expressions are taken into account for the dependency analysis. Can you check if that works for you on main and close if it's the case? Thanks!

W95Psp avatar Mar 14 '24 11:03 W95Psp

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

github-actions[bot] avatar Oct 04 '24 02:10 github-actions[bot]

This issue has been closed due to a lack of activity since being marked as stale. If you believe this issue is still relevant, please reopen it with an update or comment.

github-actions[bot] avatar Oct 12 '24 02:10 github-actions[bot]