rust/compiler/rustc_span/src
Guillaume Gomez fe5f734e6a
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`
2024-09-20 19:46:38 +02:00
..
analyze_source_file Be more accurate about calculating display_col from a BytePos 2024-07-18 20:08:38 +00:00
edit_distance Add test for precise algorithm used 2023-02-19 22:59:22 +00:00
source_map Be more accurate about calculating display_col from a BytePos 2024-07-18 20:08:38 +00:00
symbol Reformat use declarations. 2024-07-29 08:26:52 +10:00
analyze_source_file.rs Add warn(unreachable_pub) to rustc_span. 2024-09-03 08:49:54 +10:00
caching_source_map_view.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
def_id.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
edit_distance.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
edition.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
fatal_error.rs Auto merge of #117557 - Zoxc:panic-prio, r=petrochenkov 2023-11-09 00:39:02 +00:00
hygiene.rs chore: Fix typos in 'compiler' (batch 2) 2024-09-02 07:50:22 +02:00
lib.rs Auto merge of #129777 - nnethercote:unreachable_pub-4, r=Urgau 2024-09-03 01:27:20 +00:00
profiling.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
source_map.rs Remove needless returns detected by clippy in the compiler 2024-09-09 13:32:22 +02:00
span_encoding.rs Add warn(unreachable_pub) to rustc_span. 2024-09-03 08:49:54 +10:00
symbol.rs Rollup merge of #130526 - eholk:pin-reborrow, r=compiler-errors 2024-09-20 19:46:38 +02:00
tests.rs Add Span::trim_end 2024-06-04 13:11:45 +10:00