diff options
| author | bors <bors@rust-lang.org> | 2020-06-11 04:58:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-06-11 04:58:48 +0000 |
| commit | 3ddf48053e83f4949d00dcaf6eb8d9e28fc6bb95 (patch) | |
| tree | 77896eb87d9a6d0986920cd169e4468003ee3938 /src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs | |
| parent | e93cb961ba67c73815401291ab42b81e3e5733ae (diff) | |
| parent | c99164e7a13d7b2451464f3c0c066be9c7516a2b (diff) | |
| download | rust-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/test/ui/iterators/iter-sum-overflow-overflow-checks.rs')
0 files changed, 0 insertions, 0 deletions
