Skip to content

Commit e6dc097

Browse files
authored
Unrolled build for rust-lang#135390
Rollup merge of rust-lang#135390 - ranger-ross:readd-test-122638, r=BoxyUwU Re-added regression test for rust-lang#122638 Re-adds the test for rust-lang#122638 😄 fixes rust-lang#122638 r? `@BoxyUwU` (please let me know if this can be improved. I am still fairly new to using compiletest)
2 parents 1ab85fb + 6f833aa commit e6dc097

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/122638>.
2+
//@ check-fail
3+
#![feature(min_specialization)]
4+
impl<'a, T: std::fmt::Debug, const N: usize> Iterator for ConstChunksExact<'a, T, { N }> {
5+
//~^ ERROR not all trait items implemented, missing: `Item` [E0046]
6+
fn next(&mut self) -> Option<Self::Item> {}
7+
//~^ ERROR mismatched types [E0308]
8+
}
9+
struct ConstChunksExact<'a, T: '_, const assert: usize> {}
10+
//~^ ERROR `'_` cannot be used here [E0637]
11+
//~| ERROR lifetime parameter `'a` is never used [E0392]
12+
//~| ERROR type parameter `T` is never used [E0392]
13+
impl<'a, T: std::fmt::Debug, const N: usize> Iterator for ConstChunksExact<'a, T, {}> {
14+
//~^ ERROR mismatched types [E0308]
15+
//~| ERROR the const parameter `N` is not constrained by the impl trait, self type, or predicates [E0207]
16+
type Item = &'a [T; N]; }
17+
18+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
error[E0637]: `'_` cannot be used here
2+
--> $DIR/normalizing_with_unconstrained_impl_params.rs:9:32
3+
|
4+
LL | struct ConstChunksExact<'a, T: '_, const assert: usize> {}
5+
| ^^ `'_` is a reserved lifetime name
6+
7+
error[E0308]: mismatched types
8+
--> $DIR/normalizing_with_unconstrained_impl_params.rs:13:83
9+
|
10+
LL | impl<'a, T: std::fmt::Debug, const N: usize> Iterator for ConstChunksExact<'a, T, {}> {
11+
| ^^ expected `usize`, found `()`
12+
13+
error[E0046]: not all trait items implemented, missing: `Item`
14+
--> $DIR/normalizing_with_unconstrained_impl_params.rs:4:1
15+
|
16+
LL | impl<'a, T: std::fmt::Debug, const N: usize> Iterator for ConstChunksExact<'a, T, { N }> {
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Item` in implementation
18+
|
19+
= help: implement the missing item: `type Item = /* Type */;`
20+
21+
error[E0392]: lifetime parameter `'a` is never used
22+
--> $DIR/normalizing_with_unconstrained_impl_params.rs:9:25
23+
|
24+
LL | struct ConstChunksExact<'a, T: '_, const assert: usize> {}
25+
| ^^ unused lifetime parameter
26+
|
27+
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
28+
29+
error[E0392]: type parameter `T` is never used
30+
--> $DIR/normalizing_with_unconstrained_impl_params.rs:9:29
31+
|
32+
LL | struct ConstChunksExact<'a, T: '_, const assert: usize> {}
33+
| ^ unused type parameter
34+
|
35+
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
36+
37+
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
38+
--> $DIR/normalizing_with_unconstrained_impl_params.rs:13:30
39+
|
40+
LL | impl<'a, T: std::fmt::Debug, const N: usize> Iterator for ConstChunksExact<'a, T, {}> {
41+
| ^^^^^^^^^^^^^^ unconstrained const parameter
42+
|
43+
= note: expressions using a const parameter must map each value to a distinct output value
44+
= note: proving the result of expressions other than the parameter are unique is not supported
45+
46+
error[E0308]: mismatched types
47+
--> $DIR/normalizing_with_unconstrained_impl_params.rs:6:27
48+
|
49+
LL | fn next(&mut self) -> Option<Self::Item> {}
50+
| ---- ^^^^^^^^^^^^^^^^^^ expected `Option<_>`, found `()`
51+
| |
52+
| implicitly returns `()` as its body has no tail or `return` expression
53+
|
54+
= note: expected enum `Option<_>`
55+
found unit type `()`
56+
57+
error: aborting due to 7 previous errors
58+
59+
Some errors have detailed explanations: E0046, E0207, E0308, E0392, E0637.
60+
For more information about an error, try `rustc --explain E0046`.

0 commit comments

Comments
 (0)