Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/86800.rs: fixed with errors #1601

Merged
merged 1 commit into from
Jun 24, 2023
Merged

ices/86800.rs: fixed with errors #1601

merged 1 commit into from
Jun 24, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#86800

#![feature(type_alias_impl_trait)]

use std::future::Future;

struct Connection {}

trait Transaction {}

struct TestTransaction<'conn> {
    conn: &'conn Connection,
}

impl<'conn> Transaction for TestTransaction<'conn> {}

struct Context {}

type TransactionResult<O> = Result<O, ()>;

type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>;

fn execute_transaction_fut<'f, F, O>(
    f: F,
) -> impl FnOnce(&mut dyn Transaction) -> TransactionFuture<O>
where
    F: FnOnce(&mut dyn Transaction) -> TransactionFuture<O> + 'f,
{
    f
}

impl Context {
    async fn do_transaction<O>(
        &self,
        f: impl FnOnce(&mut dyn Transaction) -> TransactionFuture<O>,
    ) -> TransactionResult<O> {
        let mut conn = Connection {};
        let mut transaction = TestTransaction { conn: &mut conn };
        f(&mut transaction).await
    }
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `86800`
  --> /home/runner/work/glacier/glacier/ices/86800.rs:39:2
   |
39 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/86800.rs`

error: unconstrained opaque type
  --> /home/runner/work/glacier/glacier/ices/86800.rs:19:34
   |
19 | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `TransactionFuture` must be used in combination with a concrete type within the same module

error[E0792]: expected generic lifetime parameter, found `'_`
  --> /home/runner/work/glacier/glacier/ices/86800.rs:27:5
   |
19 | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>;
   |                        --- this generic parameter must be used with a generic lifetime parameter
...
27 |     f
   |     ^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0601, E0792.
For more information about an error, try `rustc --explain E0601`.
==============

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `86800`
  --> /home/runner/work/glacier/glacier/ices/86800.rs:39:2
   |
39 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/86800.rs`

error: unconstrained opaque type
  --> /home/runner/work/glacier/glacier/ices/86800.rs:19:34
   |
19 | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `TransactionFuture` must be used in combination with a concrete type within the same module

error[E0792]: expected generic lifetime parameter, found `'_`
  --> /home/runner/work/glacier/glacier/ices/86800.rs:27:5
   |
19 | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>;
   |                        --- this generic parameter must be used with a generic lifetime parameter
...
27 |     f
   |     ^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0601, E0792.
For more information about an error, try `rustc --explain E0601`.
==============
@JohnTitor JohnTitor merged commit 24b788a into master Jun 24, 2023
@JohnTitor JohnTitor deleted the autofix/ices/86800.rs branch June 24, 2023 05:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants