about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/interface.rs
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-04 19:19:24 -0700
committerGitHub <noreply@github.com>2024-10-04 19:19:24 -0700
commit68de7d11a98c87354de26097084b7b9479b710c7 (patch)
tree291bf4a2e6c4fe080ad811d513144777d951922e /compiler/rustc_interface/src/interface.rs
parent49c6d781171061c575184a0a4653fc5825a1940f (diff)
parent9b52fb555835224e085170b67857a250dd6f176b (diff)
downloadrust-68de7d11a98c87354de26097084b7b9479b710c7.tar.gz
rust-68de7d11a98c87354de26097084b7b9479b710c7.zip
Rollup merge of #130633 - eholk:pin-reborrow-self, r=compiler-errors
Add support for reborrowing pinned method receivers

This builds on #130526 to add pinned reborrowing for method receivers. This enables the folllowing examples to work:

```rust
#![feature(pin_ergonomics)]
#![allow(incomplete_features)]

use std::pin::Pin;

pub struct Foo;

impl Foo {
    fn foo(self: Pin<&mut Self>) {
    }

    fn baz(self: Pin<&Self>) {
    }
}

pub fn bar(x: Pin<&mut Foo>) {
    x.foo();
    x.foo();

    x.baz(); // Pin<&mut Foo> is downgraded to Pin<&Foo>
}

pub fn baaz(x: Pin<&Foo>) {
    x.baz();
    x.baz();
}
```

This PR includes the original one, which is currently in the commit queue, but the only code changes are in the latest commit (d3c53aaa5c6fcb1018c58d229bc5d92202fa6880).

#130494

r? `@compiler-errors`
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
0 files changed, 0 insertions, 0 deletions