1 error[E0277]: `impl Sized` doesn't implement `Debug`
2 --> $DIR/bound-suggestions.rs:9:22
4 LL | println!("{:?}", t);
5 | ^ `impl Sized` cannot be formatted using `{:?}` because it doesn't implement `Debug`
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
10 LL | fn test_impl(t: impl Sized + std::fmt::Debug) {
13 error[E0277]: `T` doesn't implement `Debug`
14 --> $DIR/bound-suggestions.rs:15:22
16 LL | println!("{:?}", t);
17 | ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
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`
22 LL | fn test_no_bounds<T: std::fmt::Debug>(t: T) {
25 error[E0277]: `T` doesn't implement `Debug`
26 --> $DIR/bound-suggestions.rs:21:22
28 LL | println!("{:?}", t);
29 | ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
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
34 LL | fn test_one_bound<T: Sized + std::fmt::Debug>(t: T) {
37 error[E0277]: `Y` doesn't implement `Debug`
38 --> $DIR/bound-suggestions.rs:27:30
40 LL | println!("{:?} {:?}", x, y);
41 | ^ `Y` cannot be formatted using `{:?}` because it doesn't implement `Debug`
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`
46 LL | fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug {
47 | ~~~~~~~~~~~~~~~~~~~~
49 error[E0277]: `X` doesn't implement `Debug`
50 --> $DIR/bound-suggestions.rs:33:22
52 LL | println!("{:?}", x);
53 | ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
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
58 LL | fn test_one_bound_where<X>(x: X) where X: Sized + std::fmt::Debug {
61 error[E0277]: `X` doesn't implement `Debug`
62 --> $DIR/bound-suggestions.rs:39:22
64 LL | println!("{:?}", x);
65 | ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
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`
70 LL | fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: std::fmt::Debug {
71 | ++++++++++++++++++++
73 error[E0277]: the size for values of type `Self` cannot be known at compilation time
74 --> $DIR/bound-suggestions.rs:44:46
76 LL | const SIZE: usize = core::mem::size_of::<Self>();
77 | ^^^^ doesn't have a size known at compile-time
79 note: required by a bound in `std::mem::size_of`
80 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
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`
86 LL | trait Foo<T>: Sized {
89 error[E0277]: the size for values of type `Self` cannot be known at compilation time
90 --> $DIR/bound-suggestions.rs:49:46
92 LL | const SIZE: usize = core::mem::size_of::<Self>();
93 | ^^^^ doesn't have a size known at compile-time
95 note: required by a bound in `std::mem::size_of`
96 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
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`
102 LL | trait Bar: std::fmt::Display + Sized {
105 error[E0277]: the size for values of type `Self` cannot be known at compilation time
106 --> $DIR/bound-suggestions.rs:54:46
108 LL | const SIZE: usize = core::mem::size_of::<Self>();
109 | ^^^^ doesn't have a size known at compile-time
111 note: required by a bound in `std::mem::size_of`
112 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
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`
118 LL | trait Baz: Sized where Self: std::fmt::Display {
121 error[E0277]: the size for values of type `Self` cannot be known at compilation time
122 --> $DIR/bound-suggestions.rs:59:46
124 LL | const SIZE: usize = core::mem::size_of::<Self>();
125 | ^^^^ doesn't have a size known at compile-time
127 note: required by a bound in `std::mem::size_of`
128 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
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`
134 LL | trait Qux<T>: Sized where Self: std::fmt::Display {
137 error[E0277]: the size for values of type `Self` cannot be known at compilation time
138 --> $DIR/bound-suggestions.rs:64:46
140 LL | const SIZE: usize = core::mem::size_of::<Self>();
141 | ^^^^ doesn't have a size known at compile-time
143 note: required by a bound in `std::mem::size_of`
144 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
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`
150 LL | trait Bat<T>: std::fmt::Display + Sized {
153 error: aborting due to 11 previous errors
155 For more information about this error, try `rustc --explain E0277`.