-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustc_codegen_llvm: replace the first argument early in FnType::new_vtable. #52089
Conversation
.unwrap_or_else(|| { | ||
bug!("FnType::new_vtable: non-pointer self {:?}", layout) | ||
}).ty; | ||
let fat_ptr_ty = cx.tcx.mk_mut_ptr(pointee); |
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.
This variable name is confusing, given that this is not a type of a fat pointer, but rather its data pointer only.
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.
Oh, never mind, I think I got it wrong myself lol.
@bors r+ |
📌 Commit ce94518 has been approved by |
rustc_codegen_llvm: replace the first argument early in FnType::new_vtable. Fixes #51907 by removing the vtable pointer before the `ArgType` is even created. This allows any ABI to support trait object method calls, regardless of how it passes `*dyn Trait`. r? @nikomatsakis
☀️ Test successful - status-appveyor, status-travis |
compiler team discussed. Since #51907 is a stable-to-stable regression, we decided we are better off letting the fix wait another ~6 weeks rather than put this into the beta, especially so close to when the beta is going to be cut for the next stable release. |
Fixes #51907 by removing the vtable pointer before the
ArgType
is even created.This allows any ABI to support trait object method calls, regardless of how it passes
*dyn Trait
.r? @nikomatsakis