summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/closure-requirements/propagate-from-trait-match.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/nll/closure-requirements/propagate-from-trait-match.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/nll/closure-requirements/propagate-from-trait-match.rs')
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs
deleted file mode 100644
index cda781d8e..000000000
--- a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-// Test that regions which appear only in the closure's generics (in
-// this case, `'a`) are properly mapped to the creator's generics. In
-// this case, the closure constrains its type parameter `T` to outlive
-// the same `'a` for which it implements `Trait`, which can only be the `'a`
-// from the function definition.
-
-// compile-flags:-Zverbose
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-trait Trait<'a> {}
-
-fn establish_relationships<T, F>(value: T, closure: F)
-where
- F: FnOnce(T),
-{
- closure(value)
-}
-
-fn require<'a, T>(t: T)
-where
- T: Trait<'a> + 'a,
-{
-}
-
-#[rustc_regions]
-fn supply<'a, T>(value: T)
-where
- T: Trait<'a>,
-{
- establish_relationships(value, |value| {
- // This function call requires that
- //
- // (a) T: Trait<'a>
- //
- // and
- //
- // (b) T: 'a
- //
- // The latter does not hold.
-
- require(value);
- //~^ ERROR the parameter type `T` may not live long enough
- });
-}
-
-fn main() {}