-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi… #111914
Conversation
r? @oli-obk (rustbot has picked a reviewer for you, use r? to override) |
r? @bjorn3 |
This comment has been minimized.
This comment has been minimized.
compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
Outdated
Show resolved
Hide resolved
Can't you encode |
0c479d8
to
ff03d7f
Compare
This comment has been minimized.
This comment has been minimized.
ff03d7f
to
38ff85b
Compare
@compiler-errors do you think the new implementation makes sense? |
38ff85b
to
8331590
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this doesn't implement either mine or @bjorn3's suggestions, does it? I think we need to split out the branch for ty::Generator
in encode_ty
, and either:
- As bjorn3 suggested, only encode the def-id and parent substs
- As I suggested, "skip" the generator witness by destructuring the generator witness so we never encounter
ty::GeneratorWitness
inencode_ty
at all.
For the record, @bjorn3's suggestion is probably easier to implement. Generators can't be polymorphic so they are totally uniquely determined by their def path + parent substs. |
I think it implements @bjorn3's suggestion by just skipping encoding |
No, that's not exactly right. You need to get the generator substs and explicitly extract just the parent substitutions from that.
The current implementation is still encoding all the other substs except for the witness in |
Oh, I see. There are other substitutions besides the parent and the witness, and skipping just the witness will still include other substitutions besides the parent that we don't want. Thanks for pointing it out! I'll fix it. |
4ab15c2
to
308cd80
Compare
Done. Let me know if it looks good to you! |
compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
Fixes rust-lang#111184 by encoding ty::Generator parent substs only.
308cd80
to
76ff5ec
Compare
Thank you again for your time and for your help on this, @compiler-errors! Much appreciated. |
@bors r+ |
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#111670 (Require that const param tys implement `ConstParamTy`) - rust-lang#111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - rust-lang#112030 (Migrate `item_trait_alias` to Askama) - rust-lang#112150 (Support 128-bit atomics on all x86_64 Apple targets) - rust-lang#112174 (Fix broken link) - rust-lang#112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - rust-lang#112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - rust-lang#112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#111670 (Require that const param tys implement `ConstParamTy`) - rust-lang#111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - rust-lang#112030 (Migrate `item_trait_alias` to Askama) - rust-lang#112150 (Support 128-bit atomics on all x86_64 Apple targets) - rust-lang#112174 (Fix broken link) - rust-lang#112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - rust-lang#112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - rust-lang#112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #111184 by encoding ty::Generator parent substs only.