about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-10-25 16:29:48 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-11-12 10:03:06 +0000
commit9e9f5b15f5c964b2140560f164da0bcea347b7ad (patch)
tree37ed033a874242d1dba842da72ae9a9f7bbffc8d /src/test/ui
parentaf06960b2afd259e7c41a09e038659a510475771 (diff)
downloadrust-9e9f5b15f5c964b2140560f164da0bcea347b7ad.tar.gz
rust-9e9f5b15f5c964b2140560f164da0bcea347b7ad.zip
Add test for projections in async-in-trait.
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/async-await/in-trait/async-associated-types.rs4
-rw-r--r--src/test/ui/async-await/in-trait/async-associated-types.stderr57
2 files changed, 2 insertions, 59 deletions
diff --git a/src/test/ui/async-await/in-trait/async-associated-types.rs b/src/test/ui/async-await/in-trait/async-associated-types.rs
index a6f928f3b1b..974f5aaff83 100644
--- a/src/test/ui/async-await/in-trait/async-associated-types.rs
+++ b/src/test/ui/async-await/in-trait/async-associated-types.rs
@@ -1,8 +1,8 @@
-// check-fail
-// known-bug: #102682
+// check-pass
 // edition: 2021
 
 #![feature(async_fn_in_trait)]
+#![feature(impl_trait_projections)]
 #![allow(incomplete_features)]
 
 use std::fmt::Debug;
diff --git a/src/test/ui/async-await/in-trait/async-associated-types.stderr b/src/test/ui/async-await/in-trait/async-associated-types.stderr
deleted file mode 100644
index 0985150eee0..00000000000
--- a/src/test/ui/async-await/in-trait/async-associated-types.stderr
+++ /dev/null
@@ -1,57 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
-  --> $DIR/async-associated-types.rs:19:43
-   |
-LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
-   |                                           ^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
-  --> $DIR/async-associated-types.rs:16:6
-   |
-LL | impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U {
-   |      ^^
-note: ...so that the types are compatible
-  --> $DIR/async-associated-types.rs:19:43
-   |
-LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
-   |                                           ^^^^^^^^^^^^^^
-   = note: expected `(&'a U, &'b T)`
-              found `(&U, &T)`
-   = note: but, the lifetime must be valid for the static lifetime...
-note: ...so that the types are compatible
-  --> $DIR/async-associated-types.rs:19:43
-   |
-LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
-   |                                           ^^^^^^^^^^^^^^
-   = note: expected `MyTrait<'static, 'static, T>`
-              found `MyTrait<'_, '_, T>`
-
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
-  --> $DIR/async-associated-types.rs:19:43
-   |
-LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
-   |                                           ^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
-  --> $DIR/async-associated-types.rs:16:10
-   |
-LL | impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U {
-   |          ^^
-note: ...so that the types are compatible
-  --> $DIR/async-associated-types.rs:19:43
-   |
-LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
-   |                                           ^^^^^^^^^^^^^^
-   = note: expected `(&'a U, &'b T)`
-              found `(&U, &T)`
-   = note: but, the lifetime must be valid for the static lifetime...
-note: ...so that the types are compatible
-  --> $DIR/async-associated-types.rs:19:43
-   |
-LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
-   |                                           ^^^^^^^^^^^^^^
-   = note: expected `MyTrait<'static, 'static, T>`
-              found `MyTrait<'_, '_, T>`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0495`.