about summary refs log tree commit diff
path: root/tests/ui/suggestions/issue-116434-2015.rs
blob: e0438cdef253b8a4aaa30f6ce421ec4ffda8871c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//@ edition: 2015

trait Foo {
    type Clone;
    fn foo() -> Clone;
    //~^ WARNING trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
    //~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    //~| HELP if this is a dyn-compatible trait, use `dyn`
    //~| WARNING trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
    //~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    //~| HELP if this is a dyn-compatible trait, use `dyn`
    //~| ERROR the trait `Clone` is not dyn compatible [E0038]
    //~| HELP there is an associated type with the same name
    //~| HELP use `Self` to refer to the implementing type
}

trait DbHandle: Sized {}

trait DbInterface {
    type DbHandle;
    fn handle() -> DbHandle;
    //~^ WARNING trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
    //~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    //~| HELP if this is a dyn-compatible trait, use `dyn`
    //~| WARNING trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
    //~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    //~| HELP if this is a dyn-compatible trait, use `dyn`
    //~| ERROR the trait `DbHandle` is not dyn compatible [E0038]
    //~| HELP there is an associated type with the same name
    //~| HELP use `Self` to refer to the implementing type
}

fn main() {}