]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/restrict-type-not-param.stderr
Rollup merge of #105362 - WaffleLapkin:🙅, r=oli-obk
[rust.git] / src / test / ui / suggestions / restrict-type-not-param.stderr
1 error[E0369]: cannot add `T` to `Wrapper<T>`
2   --> $DIR/restrict-type-not-param.rs:8:7
3    |
4 LL |     a + b
5    |     - ^ - T
6    |     |
7    |     Wrapper<T>
8    |
9 note: an implementation of `Add<_>` might be missing for `Wrapper<T>`
10   --> $DIR/restrict-type-not-param.rs:3:1
11    |
12 LL | struct Wrapper<T>(T);
13    | ^^^^^^^^^^^^^^^^^ must implement `Add<_>`
14 note: the following trait must be implemented
15   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
16    |
17 LL | pub trait Add<Rhs = Self> {
18    | ^^^^^^^^^^^^^^^^^^^^^^^^^
19 help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
20    |
21 LL | fn qux<T>(a: Wrapper<T>, b: T) -> T where Wrapper<T>: Add<T, Output = T> {
22    |                                     ++++++++++++++++++++++++++++++++++++
23
24 error: aborting due to previous error
25
26 For more information about this error, try `rustc --explain E0369`.