Bless tests
This commit is contained in:
parent
ec79720c1e
commit
28d58f6524
26 changed files with 40 additions and 7 deletions
|
@ -9,12 +9,14 @@ use std::fmt::Debug;
|
|||
trait MyTrait<'a, 'b, T> where Self: 'a, T: Debug + Sized + 'b {
|
||||
type MyAssoc;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&'a self, key: &'b T) -> Self::MyAssoc;
|
||||
}
|
||||
|
||||
impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U {
|
||||
type MyAssoc = (&'a U, &'b T);
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
|
||||
(self, key)
|
||||
}
|
||||
|
|
|
@ -6,10 +6,12 @@
|
|||
use std::future::Future;
|
||||
|
||||
trait AsyncTrait {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn default_impl() {
|
||||
assert!(false);
|
||||
}
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn call_default_impl() {
|
||||
Self::default_impl().await
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ use std::pin::Pin;
|
|||
use std::task::Poll;
|
||||
|
||||
pub trait MyTrait {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&self) -> i32;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
use std::future::Future;
|
||||
|
||||
trait MyTrait {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&self) -> i32;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
#![allow(incomplete_features)]
|
||||
|
||||
trait MyTrait {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&self) -> i32;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn bar(&self) -> i32;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
use std::fmt::Debug;
|
||||
|
||||
trait MyTrait<'a, 'b, T> {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T) where T: Debug + Sized;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#![allow(incomplete_features)]
|
||||
|
||||
trait MyTrait<'a, 'b, T> {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#![allow(incomplete_features)]
|
||||
|
||||
pub trait Foo {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&mut self);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#![allow(incomplete_features)]
|
||||
|
||||
pub trait Foo {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&mut self);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
trait TcpStack {
|
||||
type Connection<'a>: Sized where Self: 'a;
|
||||
fn connect<'a>(&'a self) -> Self::Connection<'a>;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn async_connect<'a>(&'a self) -> Self::Connection<'a>;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ async fn yield_now() {}
|
|||
|
||||
trait AsyncIterator {
|
||||
type Item;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn next(&mut self) -> Option<Self::Item>;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
#![allow(incomplete_features)]
|
||||
|
||||
trait T {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo();
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#![allow(incomplete_features)]
|
||||
|
||||
pub trait SpiDevice {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn transaction<F, R>(&mut self);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ use std::future::Future;
|
|||
pub trait Pool {
|
||||
type Conn;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn async_callback<'a, F: FnOnce(&'a Self::Conn) -> Fut, Fut: Future<Output = ()>>(
|
||||
&'a self,
|
||||
callback: F,
|
||||
|
|
|
@ -9,6 +9,7 @@ use std::future::Future;
|
|||
use std::marker::PhantomData;
|
||||
|
||||
trait Lockable<K, V> {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn lock_all_entries(&self) -> impl Future<Output = Guard<'_>>;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
pub struct SharedState {}
|
||||
|
||||
pub trait State {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn execute(self, shared_state: &SharedState);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0658]: return type notation is experimental
|
||||
--> $DIR/feature-gate-return_type_notation.rs:14:17
|
||||
--> $DIR/feature-gate-return_type_notation.rs:15:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^^^^^^^^^
|
||||
|
@ -8,7 +8,7 @@ LL | fn foo<T: Trait<m(): Send>>() {}
|
|||
= help: add `#![feature(return_type_notation)]` to the crate attributes to enable
|
||||
|
||||
error: parenthesized generic arguments cannot be used in associated type constraints
|
||||
--> $DIR/feature-gate-return_type_notation.rs:14:17
|
||||
--> $DIR/feature-gate-return_type_notation.rs:15:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^--
|
||||
|
@ -16,7 +16,7 @@ LL | fn foo<T: Trait<m(): Send>>() {}
|
|||
| help: remove these parentheses
|
||||
|
||||
error[E0220]: associated type `m` not found for `Trait`
|
||||
--> $DIR/feature-gate-return_type_notation.rs:14:17
|
||||
--> $DIR/feature-gate-return_type_notation.rs:15:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^ associated type `m` not found
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
warning: return type notation is experimental
|
||||
--> $DIR/feature-gate-return_type_notation.rs:14:17
|
||||
--> $DIR/feature-gate-return_type_notation.rs:15:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^^^^^^^^^
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#![feature(async_fn_in_trait)]
|
||||
|
||||
trait Trait {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn m();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ trait AsyncLendingIterator {
|
|||
where
|
||||
Self: 'a;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn next(&mut self) -> Option<Self::Item<'_>>;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
use std::fmt::Debug;
|
||||
|
||||
trait Foo {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn baz(&self) -> impl Debug {
|
||||
""
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
use std::fmt::Debug;
|
||||
|
||||
trait Foo {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn baz(&self) -> &str {
|
||||
""
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#![allow(incomplete_features)]
|
||||
|
||||
pub trait Foo {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn bar<'a: 'a>(&'a mut self);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,12 +4,15 @@
|
|||
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
|
||||
|
||||
trait Trait {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo();
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn bar() -> i32;
|
||||
|
||||
fn test(&self) -> impl Sized + '_;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn baz(&self) -> &i32;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,12 +4,15 @@
|
|||
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
|
||||
|
||||
trait Trait {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo();
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn bar() -> i32;
|
||||
|
||||
fn test(&self) -> impl Sized + '_;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn baz(&self) -> &i32;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
error[E0046]: not all trait items implemented, missing: `foo`, `bar`, `test`, `baz`
|
||||
--> $DIR/suggest-missing-item.rs:18:1
|
||||
--> $DIR/suggest-missing-item.rs:21:1
|
||||
|
|
||||
LL | async fn foo();
|
||||
| --------------- `foo` from trait
|
||||
LL |
|
||||
...
|
||||
LL | async fn bar() -> i32;
|
||||
| ---------------------- `bar` from trait
|
||||
LL |
|
||||
LL | fn test(&self) -> impl Sized + '_;
|
||||
| ---------------------------------- `test` from trait
|
||||
LL |
|
||||
...
|
||||
LL | async fn baz(&self) -> &i32;
|
||||
| ---------------------------- `baz` from trait
|
||||
...
|
||||
|
|
Loading…
Add table
Reference in a new issue