2024-02-16 20:02:50 +00:00
|
|
|
//@ edition:2021
|
2024-01-20 12:41:56 +04:00
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
type Clone;
|
|
|
|
fn foo() -> Clone;
|
|
|
|
//~^ ERROR the trait `Clone` cannot be made into an object [E0038]
|
2024-02-14 12:42:32 -08:00
|
|
|
//~| HELP there is an associated type with the same name
|
2024-01-20 12:41:56 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
trait DbHandle: Sized {}
|
|
|
|
|
|
|
|
trait DbInterface {
|
|
|
|
type DbHandle;
|
|
|
|
fn handle() -> DbHandle;
|
|
|
|
//~^ ERROR the trait `DbHandle` cannot be made into an object [E0038]
|
2024-02-14 12:42:32 -08:00
|
|
|
//~| HELP there is an associated type with the same name
|
2024-01-20 12:41:56 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|