Skip to content
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

Sized handling leads to incorrect trait overlaps #1094

Closed
tjhance opened this issue Apr 30, 2024 · 0 comments · Fixed by #1172
Closed

Sized handling leads to incorrect trait overlaps #1094

tjhance opened this issue Apr 30, 2024 · 0 comments · Fixed by #1172
Assignees

Comments

@tjhance
Copy link
Collaborator

tjhance commented Apr 30, 2024

trait Tr {
    spec fn f() -> bool;
}

impl<X: Sized> Tr for X {
    spec fn f() -> bool { true }
}

impl<X> Tr for [X] {
    spec fn f() -> bool { false }
}

fn test() {
    assert(<[u8] as Tr>::f() == true);
    assert(<[u8] as Tr>::f() == false);
    assert(false);
}

Related: #1047 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants