]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/bound-suggestions.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / bound-suggestions.stderr
1 error[E0277]: `impl Sized` doesn't implement `Debug`
2   --> $DIR/bound-suggestions.rs:9:22
3    |
4 LL |     println!("{:?}", t);
5    |                      ^ `impl Sized` cannot be formatted using `{:?}` because it doesn't implement `Debug`
6    |
7    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
8 help: consider further restricting this bound
9    |
10 LL | fn test_impl(t: impl Sized + std::fmt::Debug) {
11    |                            +++++++++++++++++
12
13 error[E0277]: `T` doesn't implement `Debug`
14   --> $DIR/bound-suggestions.rs:15:22
15    |
16 LL |     println!("{:?}", t);
17    |                      ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
18    |
19    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
20 help: consider restricting type parameter `T`
21    |
22 LL | fn test_no_bounds<T: std::fmt::Debug>(t: T) {
23    |                    +++++++++++++++++
24
25 error[E0277]: `T` doesn't implement `Debug`
26   --> $DIR/bound-suggestions.rs:21:22
27    |
28 LL |     println!("{:?}", t);
29    |                      ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
30    |
31    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
32 help: consider further restricting this bound
33    |
34 LL | fn test_one_bound<T: Sized + std::fmt::Debug>(t: T) {
35    |                            +++++++++++++++++
36
37 error[E0277]: `Y` doesn't implement `Debug`
38   --> $DIR/bound-suggestions.rs:27:30
39    |
40 LL |     println!("{:?} {:?}", x, y);
41    |                              ^ `Y` cannot be formatted using `{:?}` because it doesn't implement `Debug`
42    |
43    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
44 help: consider further restricting type parameter `Y`
45    |
46 LL | fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug {
47    |                                                                   ~~~~~~~~~~~~~~~~~~~~
48
49 error[E0277]: `X` doesn't implement `Debug`
50   --> $DIR/bound-suggestions.rs:33:22
51    |
52 LL |     println!("{:?}", x);
53    |                      ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
54    |
55    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
56 help: consider further restricting this bound
57    |
58 LL | fn test_one_bound_where<X>(x: X) where X: Sized + std::fmt::Debug {
59    |                                                 +++++++++++++++++
60
61 error[E0277]: `X` doesn't implement `Debug`
62   --> $DIR/bound-suggestions.rs:39:22
63    |
64 LL |     println!("{:?}", x);
65    |                      ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
66    |
67    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
68 help: consider further restricting this bound
69    |
70 LL | fn test_many_bounds_where<X>(x: X) where X: Sized + std::fmt::Debug, X: Sized {
71    |                                                   +++++++++++++++++
72
73 error[E0277]: the size for values of type `Self` cannot be known at compilation time
74   --> $DIR/bound-suggestions.rs:44:46
75    |
76 LL |     const SIZE: usize = core::mem::size_of::<Self>();
77    |                                              ^^^^ doesn't have a size known at compile-time
78    |
79 note: required by a bound in `std::mem::size_of`
80   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
81 help: consider further restricting `Self`
82    |
83 LL | trait Foo<T>: Sized {
84    |             +++++++
85
86 error[E0277]: the size for values of type `Self` cannot be known at compilation time
87   --> $DIR/bound-suggestions.rs:49:46
88    |
89 LL |     const SIZE: usize = core::mem::size_of::<Self>();
90    |                                              ^^^^ doesn't have a size known at compile-time
91    |
92 note: required by a bound in `std::mem::size_of`
93   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
94 help: consider further restricting `Self`
95    |
96 LL | trait Bar: std::fmt::Display + Sized {
97    |                              +++++++
98
99 error[E0277]: the size for values of type `Self` cannot be known at compilation time
100   --> $DIR/bound-suggestions.rs:54:46
101    |
102 LL |     const SIZE: usize = core::mem::size_of::<Self>();
103    |                                              ^^^^ doesn't have a size known at compile-time
104    |
105 note: required by a bound in `std::mem::size_of`
106   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
107 help: consider further restricting `Self`
108    |
109 LL | trait Baz: Sized where Self: std::fmt::Display {
110    |          +++++++
111
112 error[E0277]: the size for values of type `Self` cannot be known at compilation time
113   --> $DIR/bound-suggestions.rs:59:46
114    |
115 LL |     const SIZE: usize = core::mem::size_of::<Self>();
116    |                                              ^^^^ doesn't have a size known at compile-time
117    |
118 note: required by a bound in `std::mem::size_of`
119   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
120 help: consider further restricting `Self`
121    |
122 LL | trait Qux<T>: Sized where Self: std::fmt::Display {
123    |             +++++++
124
125 error[E0277]: the size for values of type `Self` cannot be known at compilation time
126   --> $DIR/bound-suggestions.rs:64:46
127    |
128 LL |     const SIZE: usize = core::mem::size_of::<Self>();
129    |                                              ^^^^ doesn't have a size known at compile-time
130    |
131 note: required by a bound in `std::mem::size_of`
132   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
133 help: consider further restricting `Self`
134    |
135 LL | trait Bat<T>: std::fmt::Display + Sized {
136    |                                 +++++++
137
138 error: aborting due to 11 previous errors
139
140 For more information about this error, try `rustc --explain E0277`.