]> git.lizzy.rs Git - rust.git/commit - src/librustc_llvm/build.rs
Auto merge of #74670 - tmandry:issue-73818, r=matthewjasper
authorbors <bors@rust-lang.org>
Sat, 25 Jul 2020 23:37:07 +0000 (23:37 +0000)
committerbors <bors@rust-lang.org>
Sat, 25 Jul 2020 23:37:07 +0000 (23:37 +0000)
commitbb85981a3ac31c32d2f5924eb812c0a71baabf38
tree3d4e1f293f43cfea473ae9b52e7b41dba9932963
parentd6953df14657f5932270ad2b33bccafe6f39fad4
parente35d2867f14a36094bdceadc731fdd1d26882fc9
Auto merge of #74670 - tmandry:issue-73818, r=matthewjasper

Normalize bounds fully when checking defaulted types

When checking that the default type for `<T as X>::Y` is valid in this example:

```
trait X { type Y: PartialEq<<Self as X>::Y> }
impl X for T { default type Y = S; }
```

We will have to prove the bound `S: PartialEq<<T as X>::Y>`. In this case
we want `<T as X>::Y` to normalize to `S`. This is valid because we are
checking the default value specifically here. Add `<T as X>::Y = S` to the
ParamEnv for normalization _of the bound we are checking_ only.

Fixes #73818.

---

I noticed that adding this to the env for bounds checking didn't break any tests. Not sure if this is because we can't rely on it to prove anything, or because of missing test coverage.

r? @matthewjasper, @nikomatsakis