Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

RLS falls on infinite compilation on polymorphic recursion #714

Open
Genarito opened this issue Dec 10, 2019 · 0 comments
Open

RLS falls on infinite compilation on polymorphic recursion #714

Genarito opened this issue Dec 10, 2019 · 0 comments

Comments

@Genarito
Copy link

Frist of all, thank you for this awesome plugin.

When you have code like this:

enum Tree<A> {
    Leaf(A),
    Node(Box<Tree<(A, A)>>)
}

fn size<A>(t: &Tree<A>) -> usize {
    match t {
        Tree::Leaf(_) => 1,
        Tree::Node(t) => size(t)
    }
}

fn main () {
    let tree = Tree::Leaf(4);
    println!("{}", size(&tree));
}

Where there is a polymorphic recursion which generates a problem with rustc as discussed in these issues (issue 1, issue 2).
It keeps compiling when you open VS Code, putting the CPU at a 100% load. It would be great if you could add a timeout to prevent this kind of problem when you are trying with this kind of concepts.

Thanks in advance and sorry about my English

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

1 participant