Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
dotdash:method_attr
Mar 2, 2015
Merged

Emit proper attributes for the self pointer in method call through trait...#22935
bors merged 1 commit into
rust-lang:masterfrom
dotdash:method_attr

Conversation

@dotdash

Copy link
Copy Markdown
Contributor

... 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
Copy Markdown
Contributor

r? @pnkfelix

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

@dotdash

Copy link
Copy Markdown
ContributorAuthor

r? @eddyb

@rust-highfiverust-highfive assigned eddyb and unassigned pnkfelixMar 1, 2015
Comment threadsrc/librustc_trans/trans/callee.rs Outdated

Copy link
Copy Markdown
Contributor

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

eddyb commented Mar 1, 2015

Copy link
Copy Markdown
Contributor

@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:masterMar 2, 2015
@dotdash
dotdash deleted the method_attr branch May 8, 2015 08:46
Sign up for freeto 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

@dotdash@rust-highfive@eddyb@pnkfelix@bors