]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #89441 - Nadrieril:fix-89393, r=tmandry
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 1 Oct 2021 21:46:52 +0000 (14:46 -0700)
committerGitHub <noreply@github.com>
Fri, 1 Oct 2021 21:46:52 +0000 (14:46 -0700)
commit5ab1245303c26d3ae33b1adaa89fef2b8d9fb9ca
treebbd7a3f43561a8f7c88d76fc9b162c4bf7620069
parentb458ecf29dc65e3e62785a4e3fdacbec1f18188b
parent68b76a48358e611e31de8e96c56b9e50862a960e
Rollup merge of #89441 - Nadrieril:fix-89393, r=tmandry

Normalize after substituting via `field.ty()`

Back in https://github.com/rust-lang/rust/issues/72476 I hadn't understood where the problem was coming from, and only worked around the issue. What happens is that calling `field.ty()` on a field of a generic struct substitutes the appropriate generics but doesn't normalize the resulting type.
As a consumer of types I'm surprised that one would substitute without normalizing, feels like a footgun, so I added a comment.

Fixes https://github.com/rust-lang/rust/issues/89393.
compiler/rustc_middle/src/ty/mod.rs