-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-codegenArea: Code generationArea: Code generationA-trait-systemArea: Trait systemArea: Trait systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I did not manage to reproduce in a minimal sample, but in my application, I ended up with:
let x = …;
let y = …;
println!("{:p} == {:p} ? {}", x, y, ptr::eq(x, y));
printing:
0x7f87a8c3a618 == 0x7f87a8c3a618 ? false
After investigations (and discussion on freenode/##rust), it appeared that x
and y
were fat pointers having the same data part (the 64 first bits), but a different vtable (the last 64 bits).
I applied this patch to my application, which solves the reported issue: Genymobile/gnirehtet@c36fa4d
But I can't understand how two fat pointers for the same objects may have different vtables. Is it expected?
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationA-trait-systemArea: Trait systemArea: Trait systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.