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 #1198

Closed
wants to merge 1 commit into from
Closed

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: aborting due to 2 previous errors

For more information about this 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: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0601`.
==============
@Alexendoo Alexendoo closed this in 1714f42 Mar 31, 2022
@Alexendoo Alexendoo deleted the autofix/ices/86800.rs branch March 31, 2022 21:54
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.

1 participant