summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/bound-suggestions.stderr
blob: d53715937f7d841ed3be7007bfe747c91700d84f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
error[E0277]: `impl Sized` doesn't implement `Debug`
  --> $DIR/bound-suggestions.rs:9:22
   |
LL |     println!("{:?}", t);
   |                      ^ `impl Sized` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = 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)
help: consider further restricting this bound
   |
LL | fn test_impl(t: impl Sized + std::fmt::Debug) {
   |                            +++++++++++++++++

error[E0277]: `T` doesn't implement `Debug`
  --> $DIR/bound-suggestions.rs:15:22
   |
LL |     println!("{:?}", t);
   |                      ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = 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)
help: consider restricting type parameter `T`
   |
LL | fn test_no_bounds<T: std::fmt::Debug>(t: T) {
   |                    +++++++++++++++++

error[E0277]: `T` doesn't implement `Debug`
  --> $DIR/bound-suggestions.rs:21:22
   |
LL |     println!("{:?}", t);
   |                      ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = 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)
help: consider further restricting this bound
   |
LL | fn test_one_bound<T: Sized + std::fmt::Debug>(t: T) {
   |                            +++++++++++++++++

error[E0277]: `Y` doesn't implement `Debug`
  --> $DIR/bound-suggestions.rs:27:30
   |
LL |     println!("{:?} {:?}", x, y);
   |                              ^ `Y` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = 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)
help: consider further restricting type parameter `Y`
   |
LL | fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug {
   |                                                                   ~~~~~~~~~~~~~~~~~~~~

error[E0277]: `X` doesn't implement `Debug`
  --> $DIR/bound-suggestions.rs:33:22
   |
LL |     println!("{:?}", x);
   |                      ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = 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)
help: consider further restricting this bound
   |
LL | fn test_one_bound_where<X>(x: X) where X: Sized + std::fmt::Debug {
   |                                                 +++++++++++++++++

error[E0277]: `X` doesn't implement `Debug`
  --> $DIR/bound-suggestions.rs:39:22
   |
LL |     println!("{:?}", x);
   |                      ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = 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)
help: consider further restricting this bound
   |
LL | fn test_many_bounds_where<X>(x: X) where X: Sized + std::fmt::Debug, X: Sized {
   |                                                   +++++++++++++++++

error[E0277]: the size for values of type `Self` cannot be known at compilation time
  --> $DIR/bound-suggestions.rs:44:46
   |
LL |     const SIZE: usize = core::mem::size_of::<Self>();
   |                                              ^^^^ doesn't have a size known at compile-time
   |
note: required by a bound in `std::mem::size_of`
  --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
   |
LL | pub const fn size_of<T>() -> usize {
   |                      ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
   |
LL | trait Foo<T>: Sized {
   |             +++++++

error[E0277]: the size for values of type `Self` cannot be known at compilation time
  --> $DIR/bound-suggestions.rs:49:46
   |
LL |     const SIZE: usize = core::mem::size_of::<Self>();
   |                                              ^^^^ doesn't have a size known at compile-time
   |
note: required by a bound in `std::mem::size_of`
  --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
   |
LL | pub const fn size_of<T>() -> usize {
   |                      ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
   |
LL | trait Bar: std::fmt::Display + Sized {
   |                              +++++++

error[E0277]: the size for values of type `Self` cannot be known at compilation time
  --> $DIR/bound-suggestions.rs:54:46
   |
LL |     const SIZE: usize = core::mem::size_of::<Self>();
   |                                              ^^^^ doesn't have a size known at compile-time
   |
note: required by a bound in `std::mem::size_of`
  --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
   |
LL | pub const fn size_of<T>() -> usize {
   |                      ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
   |
LL | trait Baz: Sized where Self: std::fmt::Display {
   |          +++++++

error[E0277]: the size for values of type `Self` cannot be known at compilation time
  --> $DIR/bound-suggestions.rs:59:46
   |
LL |     const SIZE: usize = core::mem::size_of::<Self>();
   |                                              ^^^^ doesn't have a size known at compile-time
   |
note: required by a bound in `std::mem::size_of`
  --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
   |
LL | pub const fn size_of<T>() -> usize {
   |                      ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
   |
LL | trait Qux<T>: Sized where Self: std::fmt::Display {
   |             +++++++

error[E0277]: the size for values of type `Self` cannot be known at compilation time
  --> $DIR/bound-suggestions.rs:64:46
   |
LL |     const SIZE: usize = core::mem::size_of::<Self>();
   |                                              ^^^^ doesn't have a size known at compile-time
   |
note: required by a bound in `std::mem::size_of`
  --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
   |
LL | pub const fn size_of<T>() -> usize {
   |                      ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
   |
LL | trait Bat<T>: std::fmt::Display + Sized {
   |                                 +++++++

error: aborting due to 11 previous errors

For more information about this error, try `rustc --explain E0277`.