Skip to content

return type sized check occurs in opaque defining env #150

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

Closed
compiler-errors opened this issue Jan 22, 2025 · 0 comments · Fixed by rust-lang/rust#136274
Closed

return type sized check occurs in opaque defining env #150

compiler-errors opened this issue Jan 22, 2025 · 0 comments · 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
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 4, 2025
Rollup merge of rust-lang#136274 - compiler-errors:sized-wf, r=lcnr

Check Sizedness of return type in WF

Still need to clean this up a bit. This should fix rust-lang/trait-system-refactor-initiative#150.

r? lcnr
RalfJung pushed a commit to RalfJung/miri that referenced this issue Feb 5, 2025
Check Sizedness of return type in WF

Still need to clean this up a bit. This should fix rust-lang/trait-system-refactor-initiative#150.

r? lcnr
@lcnr lcnr moved this from unknown to done in -Znext-solver=globally Feb 5, 2025
@lcnr lcnr moved this to todo in -Znext-solver=globally Feb 6, 2025
@lcnr lcnr moved this from todo to done in -Znext-solver=globally Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

1 participant