|
| 1 | +error[E0308]: mismatched types |
| 2 | + --> $DIR/issue-69306.rs:5:28 |
| 3 | + | |
| 4 | +LL | impl<T> S0<T> { |
| 5 | + | - this type parameter |
| 6 | +LL | const C: S0<u8> = Self(0); |
| 7 | + | ^ expected type parameter `T`, found integer |
| 8 | + | |
| 9 | + = note: expected type parameter `T` |
| 10 | + found type `{integer}` |
| 11 | + = help: type parameters must be constrained to match other types |
| 12 | + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters |
| 13 | + |
| 14 | +error[E0308]: mismatched types |
| 15 | + --> $DIR/issue-69306.rs:5:23 |
| 16 | + | |
| 17 | +LL | impl<T> S0<T> { |
| 18 | + | - this type parameter |
| 19 | +LL | const C: S0<u8> = Self(0); |
| 20 | + | ^^^^^^^ expected `u8`, found type parameter `T` |
| 21 | + | |
| 22 | + = note: expected struct `S0<u8>` |
| 23 | + found struct `S0<T>` |
| 24 | + = help: type parameters must be constrained to match other types |
| 25 | + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters |
| 26 | + |
| 27 | +error[E0308]: mismatched types |
| 28 | + --> $DIR/issue-69306.rs:10:14 |
| 29 | + | |
| 30 | +LL | impl<T> S0<T> { |
| 31 | + | - this type parameter |
| 32 | +... |
| 33 | +LL | Self(0); |
| 34 | + | ^ expected type parameter `T`, found integer |
| 35 | + | |
| 36 | + = note: expected type parameter `T` |
| 37 | + found type `{integer}` |
| 38 | + = help: type parameters must be constrained to match other types |
| 39 | + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters |
| 40 | + |
| 41 | +error[E0308]: mismatched types |
| 42 | + --> $DIR/issue-69306.rs:27:14 |
| 43 | + | |
| 44 | +LL | impl<T> Foo<T> for <S0<T> as Fun>::Out { |
| 45 | + | - this type parameter |
| 46 | +LL | fn foo() { |
| 47 | +LL | Self(0); |
| 48 | + | ^ expected type parameter `T`, found integer |
| 49 | + | |
| 50 | + = note: expected type parameter `T` |
| 51 | + found type `{integer}` |
| 52 | + = help: type parameters must be constrained to match other types |
| 53 | + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters |
| 54 | + |
| 55 | +error[E0308]: mismatched types |
| 56 | + --> $DIR/issue-69306.rs:33:32 |
| 57 | + | |
| 58 | +LL | impl<T> S1<T, u8> { |
| 59 | + | - this type parameter |
| 60 | +LL | const C: S1<u8, u8> = Self(0, 1); |
| 61 | + | ^ expected type parameter `T`, found integer |
| 62 | + | |
| 63 | + = note: expected type parameter `T` |
| 64 | + found type `{integer}` |
| 65 | + = help: type parameters must be constrained to match other types |
| 66 | + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters |
| 67 | + |
| 68 | +error[E0308]: mismatched types |
| 69 | + --> $DIR/issue-69306.rs:33:27 |
| 70 | + | |
| 71 | +LL | impl<T> S1<T, u8> { |
| 72 | + | - this type parameter |
| 73 | +LL | const C: S1<u8, u8> = Self(0, 1); |
| 74 | + | ^^^^^^^^^^ expected `u8`, found type parameter `T` |
| 75 | + | |
| 76 | + = note: expected struct `S1<u8, _>` |
| 77 | + found struct `S1<T, _>` |
| 78 | + = help: type parameters must be constrained to match other types |
| 79 | + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters |
| 80 | + |
| 81 | +error[E0308]: mismatched types |
| 82 | + --> $DIR/issue-69306.rs:41:14 |
| 83 | + | |
| 84 | +LL | impl<T> S2<T> { |
| 85 | + | - expected type parameter |
| 86 | +LL | fn map<U>(x: U) -> S2<U> { |
| 87 | + | - found type parameter |
| 88 | +LL | Self(x) |
| 89 | + | ^ expected type parameter `T`, found type parameter `U` |
| 90 | + | |
| 91 | + = note: expected type parameter `T` |
| 92 | + found type parameter `U` |
| 93 | + = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound |
| 94 | + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters |
| 95 | + |
| 96 | +error[E0308]: mismatched types |
| 97 | + --> $DIR/issue-69306.rs:41:9 |
| 98 | + | |
| 99 | +LL | impl<T> S2<T> { |
| 100 | + | - found type parameter |
| 101 | +LL | fn map<U>(x: U) -> S2<U> { |
| 102 | + | - ----- expected `S2<U>` because of return type |
| 103 | + | | |
| 104 | + | expected type parameter |
| 105 | +LL | Self(x) |
| 106 | + | ^^^^^^^ expected type parameter `U`, found type parameter `T` |
| 107 | + | |
| 108 | + = note: expected struct `S2<U>` |
| 109 | + found struct `S2<T>` |
| 110 | + = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound |
| 111 | + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters |
| 112 | + |
| 113 | +error: aborting due to 8 previous errors |
| 114 | + |
| 115 | +For more information about this error, try `rustc --explain E0308`. |
0 commit comments