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

Merged
merged 1 commit into from
Feb 9, 2022
Merged

ices/86800.rs: fixed with errors #1121

merged 1 commit into from
Feb 9, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 9, 2022

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:1:1
   |
1  | / #![feature(type_alias_impl_trait)]
2  | |
3  | | use std::future::Future;
4  | |
...  |
38 | |     }
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:1:1
   |
1  | / #![feature(type_alias_impl_trait)]
2  | |
3  | | use std::future::Future;
4  | |
...  |
38 | |     }
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 merged commit 06c8426 into master Feb 9, 2022
@Alexendoo Alexendoo deleted the autofix/ices/86800.rs branch February 9, 2022 12: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.

2 participants