about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-29 03:11:41 -0700
committerGitHub <noreply@github.com>2024-10-29 03:11:41 -0700
commitb8f08fe023f9d18b5047cbc6a9607c8c90c5ac04 (patch)
treeef24f9918826e2c53946425028195333112e8537 /compiler/rustc_codegen_llvm/src
parente97286e7389794e2bfc45a3c3702aa932b725d99 (diff)
parent6ab87f82384d0265b486ba2aa41dcf942bd42c4f (diff)
downloadrust-b8f08fe023f9d18b5047cbc6a9607c8c90c5ac04.tar.gz
rust-b8f08fe023f9d18b5047cbc6a9607c8c90c5ac04.zip
Rollup merge of #132194 - compiler-errors:rpitit-super-wc, r=spastorino
Collect item bounds for RPITITs from trait where clauses just like associated types

We collect item bounds from trait where clauses for *associated types*, i.e. this:

```rust
trait Foo
where
    Self::Assoc: Send
{
    type Assoc;
}
```

Becomes this:

```rust
trait Foo {
    type Assoc: Send;
}
```

Today, with RPITITs/AFIT and return-type notation, we don't do that, i.e.:

```rust
trait Foo where Self::method(..): Send {
    fn method() -> impl Sized;
}

fn is_send(_: impl Send) {}
fn test<T: Foo>() {
    is_send(T::method());
}
```

...which fails on nightly today.

 Turns out it's super easy to fix this, and we just need to use the `associated_type_bounds` lowering function in `explicit_item_bounds_with_filter`, which has that logic baked in.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions