summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lub-glb/empty-binders.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/lub-glb/empty-binders.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/lub-glb/empty-binders.rs')
-rw-r--r--src/test/ui/lub-glb/empty-binders.rs45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/test/ui/lub-glb/empty-binders.rs b/src/test/ui/lub-glb/empty-binders.rs
deleted file mode 100644
index f9d07e79f..000000000
--- a/src/test/ui/lub-glb/empty-binders.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-// check-pass
-//
-// Check that computing the lub works even for empty binders.
-fn lt<'a: 'a>() -> &'a () {
- &()
-}
-
-fn lt_in_fn<'a: 'a>() -> fn(&'a ()) {
- |_| ()
-}
-
-struct Contra<'a>(fn(&'a ()));
-fn lt_in_contra<'a: 'a>() -> Contra<'a> {
- Contra(|_| ())
-}
-
-fn ok<'a, 'b, 'upper, 'lower>(v: bool)
-where
- 'upper: 'a,
- 'upper: 'b,
- 'a: 'lower,
- 'b: 'lower,
-
-{
- let _: &'lower () = match v {
- true => lt::<'a>(),
- false => lt::<'b>(),
- };
-
- // This errored in the past because LUB and GLB always
- // bailed out when encountering binders, even if they were
- // empty.
- let _: fn(&'upper ()) = match v {
- true => lt_in_fn::<'a>(),
- false => lt_in_fn::<'b>(),
- };
-
- // This was already accepted, as relate didn't encounter any binders.
- let _: Contra<'upper> = match v {
- true => lt_in_contra::<'a>(),
- false => lt_in_contra::<'b>(),
- };
-}
-
-fn main() {}