]> git.lizzy.rs Git - rust.git/blob - src/test/ui/bound-suggestions.stderr
Rollup merge of #88090 - nbdd0121:inference, r=nikomatsakis
[rust.git] / src / test / ui / 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` (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` (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` (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` (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` (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` (in Nightly builds, run with -Z macro-backtrace for more info)
68 help: consider further restricting type parameter `X`
69    |
70 LL | fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: std::fmt::Debug {
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    |
82 LL | pub const fn size_of<T>() -> usize {
83    |                      ^ required by this bound in `std::mem::size_of`
84 help: consider further restricting `Self`
85    |
86 LL | trait Foo<T>: Sized {
87    |             +++++++
88
89 error[E0277]: the size for values of type `Self` cannot be known at compilation time
90   --> $DIR/bound-suggestions.rs:49:46
91    |
92 LL |     const SIZE: usize = core::mem::size_of::<Self>();
93    |                                              ^^^^ doesn't have a size known at compile-time
94    |
95 note: required by a bound in `std::mem::size_of`
96   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
97    |
98 LL | pub const fn size_of<T>() -> usize {
99    |                      ^ required by this bound in `std::mem::size_of`
100 help: consider further restricting `Self`
101    |
102 LL | trait Bar: std::fmt::Display + Sized {
103    |                              +++++++
104
105 error[E0277]: the size for values of type `Self` cannot be known at compilation time
106   --> $DIR/bound-suggestions.rs:54:46
107    |
108 LL |     const SIZE: usize = core::mem::size_of::<Self>();
109    |                                              ^^^^ doesn't have a size known at compile-time
110    |
111 note: required by a bound in `std::mem::size_of`
112   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
113    |
114 LL | pub const fn size_of<T>() -> usize {
115    |                      ^ required by this bound in `std::mem::size_of`
116 help: consider further restricting `Self`
117    |
118 LL | trait Baz: Sized where Self: std::fmt::Display {
119    |          +++++++
120
121 error[E0277]: the size for values of type `Self` cannot be known at compilation time
122   --> $DIR/bound-suggestions.rs:59:46
123    |
124 LL |     const SIZE: usize = core::mem::size_of::<Self>();
125    |                                              ^^^^ doesn't have a size known at compile-time
126    |
127 note: required by a bound in `std::mem::size_of`
128   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
129    |
130 LL | pub const fn size_of<T>() -> usize {
131    |                      ^ required by this bound in `std::mem::size_of`
132 help: consider further restricting `Self`
133    |
134 LL | trait Qux<T>: Sized where Self: std::fmt::Display {
135    |             +++++++
136
137 error[E0277]: the size for values of type `Self` cannot be known at compilation time
138   --> $DIR/bound-suggestions.rs:64:46
139    |
140 LL |     const SIZE: usize = core::mem::size_of::<Self>();
141    |                                              ^^^^ doesn't have a size known at compile-time
142    |
143 note: required by a bound in `std::mem::size_of`
144   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
145    |
146 LL | pub const fn size_of<T>() -> usize {
147    |                      ^ required by this bound in `std::mem::size_of`
148 help: consider further restricting `Self`
149    |
150 LL | trait Bat<T>: std::fmt::Display + Sized {
151    |                                 +++++++
152
153 error: aborting due to 11 previous errors
154
155 For more information about this error, try `rustc --explain E0277`.