diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-01-22 13:07:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-22 13:07:05 +0000 |
commit | 2cce6b8919ce16acd37a7a203049a52925a7e295 (patch) | |
tree | 0ac934a218d9f65af25065aa4abe94976533cb4a /gcc/rust/resolve/rust-ast-resolve-expr.h | |
parent | 6c9e57efa5474cfe5d0440e1022ee3c4a8400199 (diff) | |
parent | ee794effe3b55d2aa8acc108fb36bd8d05672dfa (diff) | |
download | gcc-2cce6b8919ce16acd37a7a203049a52925a7e295.zip gcc-2cce6b8919ce16acd37a7a203049a52925a7e295.tar.gz gcc-2cce6b8919ce16acd37a7a203049a52925a7e295.tar.bz2 |
Merge #873
873: Method resolution should respect deref lang-items r=philberty a=philberty
Method resolution in rust must respect the autoderef cycle by calling into the deref lang items as required. This
allows for method resolution behind boxing for example. See below for an example gimple dump of two levels
of deref operator overloads. The commit message ee794effe3b55d2aa8acc108fb36bd8d05672dfa holds much
more detail on the changes in this patch.
```
void main ()
{
const struct bar;
const struct foo;
const i32 foobar;
try
{
bar.0 = 123;
foo.0 = &bar;
RUSTTMP.3 = <Foo as Deref>::deref<&Bar> (&foo);
RUSTTMP.5 = <&T as Deref>::deref<Bar> (RUSTTMP.3);
foobar = Bar::foobar (*RUSTTMP.5);
}
finally
{
bar = {CLOBBER};
foo = {CLOBBER};
}
}
```
Fixes #884
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.h')
0 files changed, 0 insertions, 0 deletions