2024-01-20 02:41:56 -06:00
|
|
|
//@ edition:2021
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
type Clone;
|
|
|
|
fn foo() -> Clone;
|
2024-10-04 09:10:28 -05:00
|
|
|
//~^ ERROR expected a type, found a trait
|
|
|
|
//~| HELP `Clone` is dyn-incompatible, use `impl Clone` to return an opaque type, as long as you return a single underlying type
|
2024-02-14 14:42:32 -06:00
|
|
|
//~| HELP there is an associated type with the same name
|
2024-01-20 02:41:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
trait DbHandle: Sized {}
|
|
|
|
|
|
|
|
trait DbInterface {
|
|
|
|
type DbHandle;
|
|
|
|
fn handle() -> DbHandle;
|
2024-10-04 09:10:28 -05:00
|
|
|
//~^ ERROR expected a type, found a trait
|
|
|
|
//~| HELP `DbHandle` is dyn-incompatible, use `impl DbHandle` to return an opaque type, as long as you return a single underlying type
|
2024-02-14 14:42:32 -06:00
|
|
|
//~| HELP there is an associated type with the same name
|
2024-01-20 02:41:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|