Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 'object safe' -> 'dyn compatible' naming in tests #286

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,48 +107,48 @@ pub async fn test() {
s.calls_mut().await;
}

pub async fn test_object_safe_without_default() {
pub async fn test_dyn_compatible_without_default() {
#[async_trait]
trait ObjectSafe {
trait DynCompatible {
async fn f(&self);
}

#[async_trait]
impl ObjectSafe for Struct {
impl DynCompatible for Struct {
async fn f(&self) {}
}

let object = &Struct as &dyn ObjectSafe;
let object = &Struct as &dyn DynCompatible;
object.f().await;
}

pub async fn test_object_safe_with_default() {
pub async fn test_dyn_compatible_with_default() {
#[async_trait]
trait ObjectSafe: Sync {
trait DynCompatible: Sync {
async fn f(&self) {}
}

#[async_trait]
impl ObjectSafe for Struct {
impl DynCompatible for Struct {
async fn f(&self) {}
}

let object = &Struct as &dyn ObjectSafe;
let object = &Struct as &dyn DynCompatible;
object.f().await;
}

pub async fn test_object_no_send() {
pub async fn test_dyn_compatible_no_send() {
#[async_trait(?Send)]
trait ObjectSafe: Sync {
trait DynCompatible: Sync {
async fn f(&self) {}
}

#[async_trait(?Send)]
impl ObjectSafe for Struct {
impl DynCompatible for Struct {
async fn f(&self) {}
}

let object = &Struct as &dyn ObjectSafe;
let object = &Struct as &dyn DynCompatible;
object.f().await;
}

Expand Down