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

librustc: Don't overwrite vtables when coercing to trait object. #14830

Merged
merged 1 commit into from
Jun 19, 2014

Conversation

luqmana
Copy link
Member

@luqmana luqmana commented Jun 11, 2014

Fixes #14399.

@@ -152,21 +152,32 @@ pub struct MethodCallee {
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
pub struct MethodCall {
pub expr_id: ast::NodeId,
pub autoderef: u32
pub autoderef: u32,
pub adjustment: bool
Copy link
Contributor

Choose a reason for hiding this comment

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

The meaning of adjustment is pretty opaque. I'm not a big fan of boolean variables in general, but at least we must find a better name here to indicate what sort of adjustment you are talking about.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I couldn't think of anything better. I went with adjustment cause it's true for when we add an adjustment (AutoDeref or AutoObject).

Copy link
Contributor

Choose a reason for hiding this comment

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

On Thu, Jun 12, 2014 at 06:06:19PM -0700, Luqman Aden wrote:

Yes, I couldn't think of anything better. I went with adjustment
cause it's true for when we add an adjustment (AutoDeref or
AutoObject).

I think I don't quite understand what it means yet. I feel like we
should replace the simple autoderefs: uint either with some kind of
enum, or maybe just rename it to "adjustments: uint" and just count
AutoObject or AutoDeref uniformly. Either change will require a bit of
adjustments elsewhere.

Certainly we need a comment on MethodCall explaining how it works, and
giving a few examples (e.g., an expression with just autoderef, just
autoobject, or both, and what the different things look like). To some
extent that's pre-existing, because there should have been a comment
already: in the past, though, I know I wrote some extensive comments
along these lines for the rooting table, but we ripped that out and I
think the comments with it.

bors added a commit that referenced this pull request Jun 19, 2014
@bors bors closed this Jun 19, 2014
@bors bors merged commit 4eb5d7b into rust-lang:master Jun 19, 2014
@luqmana luqmana deleted the cmtrttcbctto branch June 19, 2014 17:24
eddyb added a commit to eddyb/rust that referenced this pull request Mar 26, 2015
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.

'could not find method while translating' while using macros
3 participants