about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-11 16:02:46 +0100
committerGitHub <noreply@github.com>2021-12-11 16:02:46 +0100
commit7083f8edfd24b1c7f2c6375badd5cc16359c84fe (patch)
tree91680d5c9a58bff8c246b8b1040b80592b9b70be /src
parent1de7815ebb9a001a07625b4bff7518b057b1ac22 (diff)
parent54ff72132c860726f40e0ff6d547b039de0a1323 (diff)
downloadrust-7083f8edfd24b1c7f2c6375badd5cc16359c84fe.tar.gz
rust-7083f8edfd24b1c7f2c6375badd5cc16359c84fe.zip
Rollup merge of #91640 - cjgillot:in-band-collect, r=oli-obk
Simplify collection of in-band lifetimes

Split from https://github.com/rust-lang/rust/pull/91403

r? ````@oli-obk````
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/async-await/generics-and-bounds.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/async-await/generics-and-bounds.rs b/src/test/ui/async-await/generics-and-bounds.rs
index 963b19b34a6..90ab0c01f54 100644
--- a/src/test/ui/async-await/generics-and-bounds.rs
+++ b/src/test/ui/async-await/generics-and-bounds.rs
@@ -2,6 +2,8 @@
 // edition:2018
 // compile-flags: --crate-type lib
 
+#![feature(in_band_lifetimes)]
+
 use std::future::Future;
 
 pub async fn simple_generic<T>() {}
@@ -71,6 +73,10 @@ pub fn call_with_ref_block<'a>(f: &'a (impl Foo + 'a)) -> impl Future<Output = (
     async move { f.foo() }
 }
 
+pub fn call_with_ref_block_in_band(f: &'a (impl Foo + 'a)) -> impl Future<Output = ()> + 'a {
+    async move { f.foo() }
+}
+
 pub fn async_block_with_same_generic_params_unifies() {
     let mut a = call_generic_bound_block(FooType);
     a = call_generic_bound_block(FooType);
@@ -85,4 +91,9 @@ pub fn async_block_with_same_generic_params_unifies() {
     let f_two = FooType;
     let mut d = call_with_ref_block(&f_one);
     d = call_with_ref_block(&f_two);
+
+    let f_one = FooType;
+    let f_two = FooType;
+    let mut d = call_with_ref_block_in_band(&f_one);
+    d = call_with_ref_block_in_band(&f_two);
 }