about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-02-13 17:46:07 -0800
committerGitHub <noreply@github.com>2025-02-13 17:46:07 -0800
commite2ee9f73189de5b64012fd9ce2ae4e1411db0ed4 (patch)
tree2e0f00d1dfdcbd71bdf1117e4abb25bd9aa70b7e /compiler/rustc_codegen_llvm/src
parenta567209daab72b7ea59eac533278064396bb0534 (diff)
parent059288ed442f34c336c759486bfe4373b61288a0 (diff)
downloadrust-e2ee9f73189de5b64012fd9ce2ae4e1411db0ed4.tar.gz
rust-e2ee9f73189de5b64012fd9ce2ae4e1411db0ed4.zip
Rollup merge of #136863 - lcnr:treat-as-rigid, r=compiler-errors
rework rigid alias handling

Necessary for https://github.com/rust-lang/rust/pull/136824 if we treat coinductive cycles as errors as we otherwise don't emit an error for

```rust
trait Overflow {
    type Assoc;
}
impl<T> Overflow for T {
    type Assoc = <T as Overflow>::Assoc;
}
```

The important part is that we only add a `RigidAlias` candidate in cases where the alias is actually supposed to be rigid:
- its trait bound has been proven via a `ParamEnv` or `ItemBound` candidate
- it's one of the special builtin traits which have a blanket impl with a `default` assoc type

This means that we now more explicitly control which aliases should rigid to avoid accidentally accepting cyclic aliases. This requires changes to diagnostics as we no longer enter an explicit `RigidAlias` candidate for `NormalizesTo` goals whose trait bound doesn't hold.

To fix this I've modified the `BestObligation` visitor always ignore `RigidAlias` candidates and to instead manually check these requirements if there are no applicable candidates. I also removed the hack for handling `structurally_normalize_ty` failures. This fixes #134905 as we no longer continue to use the `EvalCtxt` even though a nested goal failed.

r? ``@compiler-errors``
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions