rust/compiler/rustc_middle
Jubilee 68de7d11a9
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`
2024-10-04 19:19:24 -07:00
..
src Rollup merge of #130633 - eholk:pin-reborrow-self, r=compiler-errors 2024-10-04 19:19:24 -07:00
Cargo.toml disable size asserts in the compiler when randomizing layouts 2024-08-31 23:56:45 +02:00
messages.ftl TL note: current means target 2024-09-20 10:02:14 -07:00
README.md

For more information about how rustc works, see the rustc dev guide.