diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs')
-rw-r--r-- | src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs b/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs deleted file mode 100644 index 5251eeee8..000000000 --- a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs +++ /dev/null @@ -1,50 +0,0 @@ -// edition:2018 -// check-pass - -trait Trait<'a, 'b> {} -impl<T> Trait<'_, '_> for T {} - -// `Invert<'a> <: Invert<'b>` if `'b: 'a`, unlike most types. -// -// I am purposefully avoiding the terms co- and contra-variant because -// their application to regions depends on how you interpreted Rust -// regions. -nikomatsakis -struct Invert<'a>(fn(&'a u8)); - -fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Invert<'a>, b: Invert<'b>) -> impl Trait<'d, 'e> -where - 'c: 'a, - 'c: 'b, - 'd: 'c, -{ - // Representing the where clauses as a graph, where `A: B` is an - // edge `B -> A`: - // - // ``` - // 'a -> 'c -> 'd - // ^ - // | - // 'b - // ``` - // - // Meanwhile we return a value &'0 u8 where we have the constraints: - // - // ``` - // '0: 'a - // '0: 'b - // '0 in ['d, 'e] - // ``` - // - // Here, ignoring the "in" constraint, the minimal choice for `'0` - // is `'c`, but that is not in the "in set". Still, that reduces - // the range of options in the "in set" to just `'d` (`'e: 'c` - // does not hold). - let p = if condition() { a } else { b }; - p -} - -fn condition() -> bool { - true -} - -fn main() {} |