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

return type sized check occurs in opaque defining env #150

Open
compiler-errors opened this issue Jan 22, 2025 · 0 comments · May be fixed by rust-lang/rust#136274
Open

return type sized check occurs in opaque defining env #150

compiler-errors opened this issue Jan 22, 2025 · 0 comments · May be fixed by rust-lang/rust#136274
Assignees

Comments

@compiler-errors
Copy link
Member

tests/ui/generic-associated-types/issue-92033.rs

fn foo() -> impl ?Sized {
    //~^ ERROR the size for values of type `impl ?Sized` cannot be known at compilation time
    ()
}

...passes in new solver because the sized check happens during typeck, and that allows us to reveal impl ?Sized: Sized to (): Sized. Not sure if that's desirable; if it's not, then we should probably move the return type sized check to wfcheck.

I think it's fine that this passes, tho.

@lcnr lcnr moved this to unknown in -Znext-solver=globally Jan 29, 2025
@lcnr lcnr moved this from unknown to potentially irrelevant in -Znext-solver=globally Jan 29, 2025
@lcnr lcnr moved this from potentially irrelevant to unknown in -Znext-solver=globally Jan 29, 2025
@compiler-errors compiler-errors self-assigned this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: unknown
Development

Successfully merging a pull request may close this issue.

1 participant