diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-09-20 19:46:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-20 19:46:38 +0200 |
| commit | fe5f734e6a0b9afe43fc98e0529ec667393f918b (patch) | |
| tree | 9ebd10f748950f7c83e5deb9c50b541a09054e93 /compiler/rustc_codegen_llvm/src | |
| parent | bf6389f077ca62b4695231ea381255487e6097ed (diff) | |
| parent | a18800f8078f3fb7b986183b53c34a6a1b921d63 (diff) | |
| download | rust-fe5f734e6a0b9afe43fc98e0529ec667393f918b.tar.gz rust-fe5f734e6a0b9afe43fc98e0529ec667393f918b.zip | |
Rollup merge of #130526 - eholk:pin-reborrow, r=compiler-errors
Begin experimental support for pin reborrowing
This commit adds basic support for reborrowing `Pin` types in argument position. At the moment it only supports reborrowing `Pin<&mut T>` as `Pin<&mut T>` by inserting a call to `Pin::as_mut()`, and only in argument position (not as the receiver in a method call).
This PR makes the following example compile:
```rust
#![feature(pin_ergonomics)]
fn foo(_: Pin<&mut Foo>) {
}
fn bar(mut x: Pin<&mut Foo>) {
foo(x);
foo(x);
}
```
Previously, you would have had to write `bar` as:
```rust
fn bar(mut x: Pin<&mut Foo>) {
foo(x.as_mut());
foo(x);
}
```
Tracking:
- #130494
r? `@compiler-errors`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
