rust/tests/ui/suggestions/issue-116434-2021.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
668 B
Rust
Raw Normal View History

//@ edition:2021
trait Foo {
type Clone;
fn foo() -> Clone;
//~^ 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
//~| HELP there is an associated type with the same name
}
trait DbHandle: Sized {}
trait DbInterface {
type DbHandle;
fn handle() -> DbHandle;
//~^ 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
//~| HELP there is an associated type with the same name
}
fn main() {}