Skip to content

Remove ParamEnv::reveal_all from codegen #75327

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
davidtwco opened this issue Aug 9, 2020 · 5 comments
Closed

Remove ParamEnv::reveal_all from codegen #75327

davidtwco opened this issue Aug 9, 2020 · 5 comments
Labels
-Zpolymorphize Unstable option: Polymorphization. A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@davidtwco
Copy link
Member

Instead of using ParamEnv::reveal_all, the ParamEnv should be tracked in the mono item - this is necessary to enable more complex forms of polymorphization in future.

something simple like trying layout_of(ty) on various types in the MIR body and ignoring generics in ty if it succeeds, should work, but the lack of a correct ParamEnv would make it fail later (especially if e.g. it's something like &T which only has a constant layout if T: Sized)

(source: eddyb in Zulip)

@davidtwco davidtwco added the -Zpolymorphize Unstable option: Polymorphization. label Aug 9, 2020
@JohnTitor JohnTitor added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 9, 2020
@RalfJung
Copy link
Member

RalfJung commented Aug 12, 2020

Likely Miri would need similar changes? Or does it not matter because Miri doesn't actually monomorphize, we just run polymorphic MIR and track the current subst?

@davidtwco
Copy link
Member Author

Likely Miri would need similar changes? Or does it not matter because Miri doesn't actually monomorphize, we just run polymorphic MIR and track the current subst?

It's possible - I'm not that sure.

@jonas-schievink jonas-schievink added the A-codegen Area: Code generation label Aug 12, 2020
@fmease
Copy link
Member

fmease commented Feb 11, 2025

Should we close this now that -Zpolymorphize has been removed or is this something future designs/implementations are bound to be affected by, too? Rephrased, is it useful to keep open "in limbo"?

@RalfJung
Copy link
Member

RalfJung commented May 8, 2025

@lcnr @BoxyUwU is there still something to track here or has this been resolved with the removal of -Zpolymorphize?

@BoxyUwU
Copy link
Member

BoxyUwU commented May 8, 2025

I think the only purpose this serves is that if -Zpolymorphize is re-added this might remind folks of this pitfall 🤔 I think its safe to close this; its not actionable until someone picks up polymorphization again which I haven't seen any movement on

@BoxyUwU BoxyUwU closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Zpolymorphize Unstable option: Polymorphization. A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants