Bless tests.

This commit is contained in:
Camille GILLOT 2022-03-11 11:58:59 +01:00
parent f901df3739
commit a621b8499f
3 changed files with 17 additions and 4 deletions

View File

@ -46,6 +46,7 @@ where
fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'_>> { fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'_>> {
//~^ ERROR: missing lifetime specifier //~^ ERROR: missing lifetime specifier
//~| ERROR: missing lifetime specifier
DocumentImpl {} DocumentImpl {}
} }

View File

@ -10,6 +10,18 @@ help: consider using the `'static` lifetime
LL | fn create_doc() -> impl Document<Cursor<'static> = DocCursorImpl<'_>> { LL | fn create_doc() -> impl Document<Cursor<'static> = DocCursorImpl<'_>> {
| ~~~~~~~ | ~~~~~~~
error: aborting due to previous error error[E0106]: missing lifetime specifier
--> $DIR/issue-70304.rs:47:61
|
LL | fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'_>> {
| ^^ expected named lifetime parameter
|
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
help: consider using the `'static` lifetime
|
LL | fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'static>> {
| ~~~~~~~
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0106`. For more information about this error, try `rustc --explain E0106`.

View File

@ -27,16 +27,16 @@ type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>
fn execute_transaction_fut<'f, F, O>( fn execute_transaction_fut<'f, F, O>(
f: F, f: F,
) -> impl FnOnce(&mut dyn Transaction) -> TransactionFuture<O> ) -> impl FnOnce(&mut dyn Transaction) -> TransactionFuture<'_, O>
where where
F: FnOnce(&mut dyn Transaction) -> TransactionFuture<O> + 'f F: FnOnce(&mut dyn Transaction) -> TransactionFuture<'_, O> + 'f
{ {
f f
} }
impl Context { impl Context {
async fn do_transaction<O>( async fn do_transaction<O>(
&self, f: impl FnOnce(&mut dyn Transaction) -> TransactionFuture<O> &self, f: impl FnOnce(&mut dyn Transaction) -> TransactionFuture<'_, O>
) -> TransactionResult<O> ) -> TransactionResult<O>
{ {
let mut conn = Connection {}; let mut conn = Connection {};