about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-11 04:58:48 +0000
committerbors <bors@rust-lang.org>2020-06-11 04:58:48 +0000
commit3ddf48053e83f4949d00dcaf6eb8d9e28fc6bb95 (patch)
tree77896eb87d9a6d0986920cd169e4468003ee3938 /src/libstd/sys
parente93cb961ba67c73815401291ab42b81e3e5733ae (diff)
parentc99164e7a13d7b2451464f3c0c066be9c7516a2b (diff)
downloadrust-3ddf48053e83f4949d00dcaf6eb8d9e28fc6bb95.tar.gz
rust-3ddf48053e83f4949d00dcaf6eb8d9e28fc6bb95.zip
Auto merge of #71896 - spastorino:existential-assoc-types-variance, r=nikomatsakis
Relate existential associated types with variance Invariant

Fixes #71550 #72315

r? @nikomatsakis

The test case reported in that issue now errors with the following message ...

```
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'a in function call due to conflicting requirements
  --> /tmp/test.rs:25:5
   |
25 |     bad(&Bar(PhantomData), x)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 24:11...
  --> /tmp/test.rs:24:11
   |
24 | fn extend<'a, T>(x: &'a T) -> &'static T {
   |           ^^
note: ...so that reference does not outlive borrowed content
  --> /tmp/test.rs:25:28
   |
25 |     bad(&Bar(PhantomData), x)
   |                            ^
   = note: but, the lifetime must be valid for the static lifetime...
note: ...so that the types are compatible
  --> /tmp/test.rs:25:9
   |
25 |     bad(&Bar(PhantomData), x)
   |         ^^^^^^^^^^^^^^^^^
   = note: expected  `&'static T`
              found  `&T`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0495`.
```

I could also add that test case if we want to have a weaponized one too.
Diffstat (limited to 'src/libstd/sys')
0 files changed, 0 insertions, 0 deletions