about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-11-28 03:14:48 +0100
committerGitHub <noreply@github.com>2024-11-28 03:14:48 +0100
commit06815d0cc12732d8de4995b76c93d3d04261fd79 (patch)
tree268fa56d52c039b36f2c86b57d7a231ffb894772 /compiler/rustc_codegen_llvm/src/errors.rs
parentb1c33f4f093cebce0d892a9aa84f4880e9a2ddc6 (diff)
parent4120fdbeab225daddec7436755074e688c8087c3 (diff)
downloadrust-06815d0cc12732d8de4995b76c93d3d04261fd79.tar.gz
rust-06815d0cc12732d8de4995b76c93d3d04261fd79.zip
Rollup merge of #133519 - compiler-errors:xform-ret-wf, r=lcnr
Check `xform_ret_ty` for WF in the new solver to improve method winnowing

This is a bit interesting. Method probing in the old solver is stronger than the new solver because eagerly normalizing types causes us to check their corresponding trait goals. This is important because we don't end up checking all of the where clauses of a method when method probing; just the where clauses of the impl. i.e., for:

```
impl Foo
where
   WC1,
{
    fn method()
    where
        WC2,
    {}
}
```

We only check WC1 and not WC2. This is because at this point in probing the method is instantiated w/ infer vars, and checking the where clauses in WC2 will lead to cycles if we were to check them (at least that's my understanding; I could investigate changing that in general, incl. in the old solver, but I don't have much confidence that it won't lead to really bad overflows.)

This PR chooses to emulate the old solver by just checking that the return type is WF. This is theoretically stronger, but I'm not too worried about it. I think we alternatively have several approaches we can take here, though this one seems the simplest. Thoughts?

r? lcnr
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions