fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.4 KiB67 linesraw
1error: impl trait in impl method signature does not match trait method signature
2  --> $DIR/refine.rs:10:22
3   |
4LL |     fn bar() -> impl Sized;
5   |                 ---------- return type from trait method defined here
6...
7LL |     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
11note: the lint level is defined here
12  --> $DIR/refine.rs:2:9
13   |
14LL | #![deny(refining_impl_trait)]
15   |         ^^^^^^^^^^^^^^^^^^^
16help: replace the return type so that it matches the trait
17   |
18LL |     fn bar() -> impl Sized {}
19   |                 ~~~~~~~~~~
20
21error: impl trait in impl method signature does not match trait method signature
22  --> $DIR/refine.rs:16:5
23   |
24LL |     fn bar() -> impl Sized;
25   |                 ---------- return type from trait method defined here
26...
27LL |     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
31help: replace the return type so that it matches the trait
32   |
33LL |     fn bar()-> impl Sized  {}
34   |             +++++++++++++
35
36error: impl trait in impl method signature does not match trait method signature
37  --> $DIR/refine.rs:22:17
38   |
39LL |     fn bar() -> impl Sized;
40   |                 ---------- return type from trait method defined here
41...
42LL |     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
46help: replace the return type so that it matches the trait
47   |
48LL |     fn bar() -> impl Sized {}
49   |                 ~~~~~~~~~~
50
51error: impl trait in impl method signature does not match trait method signature
52  --> $DIR/refine.rs:44:27
53   |
54LL |     fn bar<'a>(&'a self) -> impl Sized + 'a;
55   |                             --------------- return type from trait method defined here
56...
57LL |     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
61help: replace the return type so that it matches the trait
62   |
63LL |     fn bar(&self) -> impl Sized + '_ {}
64   |                      ~~~~~~~~~~~~~~~
65
66error: aborting due to 4 previous errors
67