1 error[E0308]: mismatched types
2 --> $DIR/return-impl-trait-bad.rs:5:5
4 LL | fn bad_echo<T>(_t: T) -> T {
5 | - - expected `T` because of return type
8 LL | "this should not suggest impl Trait"
9 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&str`
11 = note: expected type parameter `T`
12 found reference `&'static str`
14 error[E0308]: mismatched types
15 --> $DIR/return-impl-trait-bad.rs:9:5
17 LL | fn bad_echo_2<T: Trait>(_t: T) -> T {
18 | - - expected `T` because of return type
21 LL | "this will not suggest it, because that would probably be wrong"
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&str`
24 = note: expected type parameter `T`
25 found reference `&'static str`
27 error[E0308]: mismatched types
28 --> $DIR/return-impl-trait-bad.rs:17:5
30 LL | fn other_bounds_bad<T>() -> T
31 | - - expected `T` because of return type
35 LL | "don't suggest this, because Option<T> places additional constraints"
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&str`
38 = note: expected type parameter `T`
39 found reference `&'static str`
41 error[E0308]: mismatched types
42 --> $DIR/return-impl-trait-bad.rs:28:5
44 LL | fn used_in_trait<T>() -> T
47 | | expected `T` because of return type
48 | | help: consider using an impl return type: `impl Send`
51 LL | "don't suggest this, because the generic param is used in the bound."
52 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&str`
54 = note: expected type parameter `T`
55 found reference `&'static str`
57 error: aborting due to 4 previous errors
59 For more information about this error, try `rustc --explain E0308`.