]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/restrict-type-not-param.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / 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 trait `Add` must be implemented
15   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
16 help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
17    |
18 LL | fn qux<T>(a: Wrapper<T>, b: T) -> T where Wrapper<T>: Add<T, Output = T> {
19    |                                     ++++++++++++++++++++++++++++++++++++
20
21 error: aborting due to previous error
22
23 For more information about this error, try `rustc --explain E0369`.