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

rustc_codegen_llvm: replace the first argument early in FnType::new_vtable. #52089

Merged
merged 1 commit into from
Jul 12, 2018

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Jul 5, 2018

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 5, 2018
.unwrap_or_else(|| {
bug!("FnType::new_vtable: non-pointer self {:?}", layout)
}).ty;
let fat_ptr_ty = cx.tcx.mk_mut_ptr(pointee);
Copy link
Member

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.

Copy link
Member

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.

@nagisa
Copy link
Member

nagisa commented Jul 11, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Jul 11, 2018

📌 Commit ce94518 has been approved by nagisa

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 11, 2018
@bors
Copy link
Contributor

bors commented Jul 12, 2018

⌛ Testing commit ce94518 with merge 3244d53...

bors added a commit that referenced this pull request Jul 12, 2018
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
@bors
Copy link
Contributor

bors commented Jul 12, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: nagisa
Pushing 3244d53 to master...

@bors bors merged commit ce94518 into rust-lang:master Jul 12, 2018
@eddyb eddyb deleted the issue-51907 branch July 13, 2018 06:34
@pietroalbini pietroalbini added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 13, 2018
@pnkfelix
Copy link
Member

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.

@pnkfelix pnkfelix removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants