]> git.proxmox.com Git - rustc.git/blob - tests/ui/impl-trait/in-trait/refine.stderr
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / ui / impl-trait / in-trait / refine.stderr
1 error: impl trait in impl method signature does not match trait method signature
2 --> $DIR/refine.rs:10:22
3 |
4 LL | fn bar() -> impl Sized;
5 | ---------- return type from trait method defined here
6 ...
7 LL | fn bar() -> impl Copy {}
8 | ^^^^ this bound is stronger than that defined on the trait
9 |
10 = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
11 note: the lint level is defined here
12 --> $DIR/refine.rs:2:9
13 |
14 LL | #![deny(refining_impl_trait)]
15 | ^^^^^^^^^^^^^^^^^^^
16 help: replace the return type so that it matches the trait
17 |
18 LL | fn bar() -> impl Sized {}
19 | ~~~~~~~~~~
20
21 error: impl trait in impl method signature does not match trait method signature
22 --> $DIR/refine.rs:16:5
23 |
24 LL | fn bar() -> impl Sized;
25 | ---------- return type from trait method defined here
26 ...
27 LL | fn bar() {}
28 | ^^^^^^^^
29 |
30 = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
31 help: replace the return type so that it matches the trait
32 |
33 LL | fn bar() -> impl Sized {}
34 | +++++++++++++
35
36 error: impl trait in impl method signature does not match trait method signature
37 --> $DIR/refine.rs:22:17
38 |
39 LL | fn bar() -> impl Sized;
40 | ---------- return type from trait method defined here
41 ...
42 LL | fn bar() -> () {}
43 | ^^
44 |
45 = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
46 help: replace the return type so that it matches the trait
47 |
48 LL | fn bar() -> impl Sized {}
49 | ~~~~~~~~~~
50
51 error: impl trait in impl method signature does not match trait method signature
52 --> $DIR/refine.rs:44:27
53 |
54 LL | fn bar<'a>(&'a self) -> impl Sized + 'a;
55 | --------------- return type from trait method defined here
56 ...
57 LL | fn bar(&self) -> impl Copy + '_ {}
58 | ^^^^ this bound is stronger than that defined on the trait
59 |
60 = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
61 help: replace the return type so that it matches the trait
62 |
63 LL | fn bar(&self) -> impl Sized + '_ {}
64 | ~~~~~~~~~~~~~~~
65
66 error: aborting due to 4 previous errors
67