Skip to content

Emit proper attributes for the self pointer in method call through trait... #22935

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

Merged
merged 1 commit into from
Mar 2, 2015

Conversation

dotdash
Copy link
Contributor

@dotdash dotdash commented Mar 1, 2015

... objects

For method calls through trait objects, we currently generate the llvm
function argument attributes using the non-opaque method signature that
still has the trait object fat pointer for the self pointer. This leads
to attributes that are plain wrong, e.g. noalias. As we don't know
anything about the concrete type of the underlying object, we must
replace the self argument with an opaque i8 pointer before applying the
attributes.

@rust-highfive
Copy link
Contributor

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@dotdash
Copy link
Contributor Author

dotdash commented Mar 1, 2015

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned pnkfelix Mar 1, 2015
},
_ => method_ty
};
let method_ty = common::monomorphize_type(bcx, method_ty);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does bcx not have a method for this? common is rather jarring IMO (though I dislike the module more than the name).

…ait objects

For method calls through trait objects, we currently generate the llvm
function argument attributes using the non-opaque method signature that
still has the trait object fat pointer for the self pointer. This leads
to attributes that are plain wrong, e.g. noalias. As we don't know
anything about the concrete type of the underlying object, we must
replace the self argument with an opaque i8 pointer before applying the
attributes.
@eddyb
Copy link
Member

eddyb commented Mar 1, 2015

@bors r+ 8b6b3c1 rollup

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 1, 2015
 ... objects

For method calls through trait objects, we currently generate the llvm
function argument attributes using the non-opaque method signature that
still has the trait object fat pointer for the self pointer. This leads
to attributes that are plain wrong, e.g. noalias. As we don't know
anything about the concrete type of the underlying object, we must
replace the self argument with an opaque i8 pointer before applying the
attributes.
@bors bors merged commit 8b6b3c1 into rust-lang:master Mar 2, 2015
@dotdash dotdash deleted the method_attr branch May 8, 2015 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants