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

name mangling and TypeId should not pass for aliases and generic params #113443

Open
lcnr opened this issue Jul 7, 2023 · 2 comments
Open

name mangling and TypeId should not pass for aliases and generic params #113443

lcnr opened this issue Jul 7, 2023 · 2 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Comments

@lcnr
Copy link
Contributor

lcnr commented Jul 7, 2023

Name mangling currently succeeds even if the mangled type contains projections or opaque types. I am not sure whether TypeId has the same issue.

This can result in linking errors or potential UB (cc #97156) and we should guard against this by failing to mangle in this case. This change is non-trivial as we currently have name mangling tests which mangle generic modules. These tests should be changed.

cc @michaelwoerister @eddyb

@lcnr lcnr added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Jul 7, 2023
@BoxyUwU
Copy link
Member

BoxyUwU commented Jul 7, 2023

Does -Zpolymorphization not require us to mangle generic params? I thought that we used generic params to represent unused substs

@lcnr
Copy link
Contributor Author

lcnr commented Jul 7, 2023

yes, I also believe that longterm we should change polymorphization to instead use Bound variables. imo using ty::Param for polymorphization makes it too easy to break substitution (or hide a missing substitution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

2 participants