]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #86506 - b-naber:gen_trait_impl_inconsistent, r=jackh726
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 8 Oct 2021 20:30:38 +0000 (22:30 +0200)
committerGitHub <noreply@github.com>
Fri, 8 Oct 2021 20:30:38 +0000 (22:30 +0200)
commit32502404e5ed78b927cc9807eac0cf6cd3623450
treeb30def107f10609fe81c12f2ad5911446f5b1c72
parent87df4dd70f13f248a4d2d22cdd96ee59d161d741
parent3215403dde605b310826d8985261d8eeed3ea983
Rollup merge of #86506 - b-naber:gen_trait_impl_inconsistent, r=jackh726

Don't normalize xform_ret_ty during method candidate assembly

Fixes https://github.com/rust-lang/rust/issues/85671

Normalizing the return type of a method candidate together with the expected receiver type of the method can lead to valid method candidates being rejected during probing. Specifically in the example of the fixed issue we have a `self_ty` of the form `&A<&[Coef]>` whereas the `impl_ty` of the method would be `&A<_>`, if we normalize the projection in the return type we unify the inference variable with `Cont`, which will lead us to reject the candidate in the sup type check in `consider_probe`. Since we don't actually need the normalized return type during candidate assembly, we postpone the normalization until we consider candidates in `consider_probe`.