rust/compiler/rustc_middle/src
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
..
dep_graph Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
hir Move in_trait into OpaqueTyOrigin 2024-10-02 22:48:26 -04:00
hooks Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
infer Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
middle cleanup: don't clone types that are Copy 2024-09-29 13:31:30 +02:00
mir Rollup merge of #130885 - RalfJung:interp-error-discard, r=oli-obk 2024-10-01 23:15:59 -07:00
query Auto merge of #130946 - matthiaskrgr:rollup-ia4mf0y, r=matthiaskrgr 2024-09-27 21:23:29 +00:00
thir be even more precise about "cast" vs "coercion" 2024-09-24 23:12:02 +02:00
traits Compiler: Rename "object safe" to "dyn compatible" 2024-09-25 13:26:48 +02:00
ty Rollup merge of #130633 - eholk:pin-reborrow-self, r=compiler-errors 2024-10-04 19:19:24 -07:00
util Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
arena.rs Compiler: Rename "object safe" to "dyn compatible" 2024-09-25 13:26:48 +02:00
error.rs Use bool in favor of Option<()> for diagnostics 2024-08-21 01:31:11 -04:00
lib.rs make InterpResult a dedicated type to avoid accidentally discarding the error 2024-10-01 21:45:35 +02:00
lint.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
macros.rs Improve const traits diagnostics for new desugaring 2024-10-02 19:45:17 +08:00
metadata.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
tests.rs Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
thir.rs be even more precise about "cast" vs "coercion" 2024-09-24 23:12:02 +02:00
values.rs only query params_in_repr if def kind is adt 2024-10-02 17:36:31 +08:00