Skip to content

Commit e2bba07

Browse files
committed
Fix list length
1 parent 883b93c commit e2bba07

28 files changed

+225
-1
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
18131813
}
18141814

18151815
let len = impl_candidates.len();
1816-
let end = if impl_candidates.len() <= 5 { impl_candidates.len() } else { 4 };
1816+
let end = if impl_candidates.len() <= 9 { impl_candidates.len() } else { 8 };
18171817

18181818
let normalize = |candidate| {
18191819
self.tcx.infer_ctxt().enter(|ref infcx| {

src/test/ui/binop/binop-mul-i32-f32.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ LL | x * y
1010
<&i32 as Mul<&i32>>
1111
<i32 as Mul<&i32>>
1212
<i32 as Mul>
13+
<&'a f32 as Mul<f32>>
14+
<&'a f64 as Mul<f64>>
15+
<&'a i128 as Mul<i128>>
16+
<&'a i16 as Mul<i16>>
1317
and 49 others
1418

1519
error: aborting due to previous error

src/test/ui/binop/issue-77910-1.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ LL | assert_eq!(foo, y);
2121
<extern "C" fn(A) -> Ret as Debug>
2222
<extern "C" fn(A, ...) -> Ret as Debug>
2323
<extern "C" fn(A, B) -> Ret as Debug>
24+
<extern "C" fn(A, B, ...) -> Ret as Debug>
25+
<extern "C" fn(A, B, C) -> Ret as Debug>
26+
<extern "C" fn(A, B, C, ...) -> Ret as Debug>
27+
<extern "C" fn(A, B, C, D) -> Ret as Debug>
2428
and 68 others
2529
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
2630

src/test/ui/binop/shift-various-bad-types.stderr

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ LL | 22 >> p.char;
1010
<&'a i128 as Shr<i16>>
1111
<&'a i128 as Shr<i32>>
1212
<&'a i128 as Shr<i64>>
13+
<&'a i128 as Shr<i8>>
14+
<&'a i128 as Shr<isize>>
15+
<&'a i128 as Shr<u128>>
16+
<&'a i128 as Shr<u16>>
1317
and 568 others
1418

1519
error[E0277]: no implementation for `{integer} >> &str`
@@ -24,6 +28,10 @@ LL | 22 >> p.str;
2428
<&'a i128 as Shr<i16>>
2529
<&'a i128 as Shr<i32>>
2630
<&'a i128 as Shr<i64>>
31+
<&'a i128 as Shr<i8>>
32+
<&'a i128 as Shr<isize>>
33+
<&'a i128 as Shr<u128>>
34+
<&'a i128 as Shr<u16>>
2735
and 568 others
2836

2937
error[E0277]: no implementation for `{integer} >> &Panolpy`
@@ -38,6 +46,10 @@ LL | 22 >> p;
3846
<&'a i128 as Shr<i16>>
3947
<&'a i128 as Shr<i32>>
4048
<&'a i128 as Shr<i64>>
49+
<&'a i128 as Shr<i8>>
50+
<&'a i128 as Shr<isize>>
51+
<&'a i128 as Shr<u128>>
52+
<&'a i128 as Shr<u16>>
4153
and 568 others
4254

4355
error[E0308]: mismatched types

src/test/ui/const-generics/exhaustive-value.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ LL | <() as Foo<N>>::test()
99
<() as Foo<100_u8>>
1010
<() as Foo<101_u8>>
1111
<() as Foo<102_u8>>
12+
<() as Foo<103_u8>>
13+
<() as Foo<104_u8>>
14+
<() as Foo<105_u8>>
15+
<() as Foo<106_u8>>
1216
and 248 others
1317

1418
error: aborting due to previous error

src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ LL | = [0; (i8::MAX + 1u8) as usize];
1616
<&i8 as Add<&i8>>
1717
<i8 as Add<&i8>>
1818
<i8 as Add>
19+
<&'a f32 as Add<f32>>
20+
<&'a f64 as Add<f64>>
21+
<&'a i128 as Add<i128>>
22+
<&'a i16 as Add<i16>>
1923
and 48 others
2024

2125
error: aborting due to 2 previous errors

src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ LL | : [u32; (i8::MAX as i8 + 1u8) as usize]
1616
<&i8 as Add<&i8>>
1717
<i8 as Add<&i8>>
1818
<i8 as Add>
19+
<&'a f32 as Add<f32>>
20+
<&'a f64 as Add<f64>>
21+
<&'a i128 as Add<i128>>
22+
<&'a i16 as Add<i16>>
1923
and 48 others
2024

2125
error[E0604]: only `u8` can be cast as `char`, not `i8`

src/test/ui/consts/too_generic_eval_ice.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ LL | [5; Self::HOST_SIZE] == [6; 0]
2626
<&[T] as PartialEq<Vec<U, A>>>
2727
<&mut [B] as PartialEq<[A; N]>>
2828
<&mut [T] as PartialEq<Vec<U, A>>>
29+
<[A; N] as PartialEq<&[B]>>
30+
<[A; N] as PartialEq<&mut [B]>>
31+
<[A; N] as PartialEq<[B; N]>>
32+
<[A; N] as PartialEq<[B]>>
2933
and 3 others
3034

3135
error: aborting due to 3 previous errors

src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ LL | f1.foo(1usize);
99
<Bar as Foo<i32>>
1010
<Bar as Foo<i8>>
1111
<Bar as Foo<u16>>
12+
<Bar as Foo<u32>>
13+
<Bar as Foo<u8>>
1214

1315
error: aborting due to previous error
1416

src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ LL | Foo::<i32>::bar(&1i8);
1111
<i8 as Foo<u16>>
1212
<i8 as Foo<u32>>
1313
<i8 as Foo<u64>>
14+
<i8 as Foo<u8>>
15+
<u8 as Foo<bool>>
16+
<u8 as Foo<u16>>
17+
<u8 as Foo<u32>>
18+
<u8 as Foo<u64>>
1419

1520
error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
1621
--> $DIR/issue-39802-show-5-trait-impls.rs:25:21
@@ -25,6 +30,11 @@ LL | Foo::<i32>::bar(&1u8);
2530
<u8 as Foo<u16>>
2631
<u8 as Foo<u32>>
2732
<u8 as Foo<u64>>
33+
<i8 as Foo<bool>>
34+
<i8 as Foo<u16>>
35+
<i8 as Foo<u32>>
36+
<i8 as Foo<u64>>
37+
<i8 as Foo<u8>>
2838

2939
error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
3040
--> $DIR/issue-39802-show-5-trait-impls.rs:26:21
@@ -39,6 +49,8 @@ LL | Foo::<i32>::bar(&true);
3949
<bool as Foo<i8>>
4050
<bool as Foo<u16>>
4151
<bool as Foo<u32>>
52+
<bool as Foo<u64>>
53+
<bool as Foo<u8>>
4254

4355
error: aborting due to 3 previous errors
4456

src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹
2727
<&'a f64 as Sub<f64>>
2828
<&'a i128 as Sub<i128>>
2929
<&'a i16 as Sub<i16>>
30+
<&'a i32 as Sub<i32>>
31+
<&'a i64 as Sub<i64>>
32+
<&'a i8 as Sub<i8>>
33+
<&'a isize as Sub<isize>>
3034
and 48 others
3135

3236
error: aborting due to 3 previous errors

src/test/ui/impl-trait/equality.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ LL | n + sum_to(n - 1)
2929
<&u32 as Add<&u32>>
3030
<u32 as Add<&u32>>
3131
<u32 as Add>
32+
<&'a f32 as Add<f32>>
33+
<&'a f64 as Add<f64>>
34+
<&'a i128 as Add<i128>>
35+
<&'a i16 as Add<i16>>
3236
and 48 others
3337

3438
error: aborting due to 2 previous errors; 1 warning emitted

src/test/ui/issues/issue-11771.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ LL | 1 +
1010
<&'a f64 as Add<f64>>
1111
<&'a i128 as Add<i128>>
1212
<&'a i16 as Add<i16>>
13+
<&'a i32 as Add<i32>>
14+
<&'a i64 as Add<i64>>
15+
<&'a i8 as Add<i8>>
16+
<&'a isize as Add<isize>>
1317
and 48 others
1418

1519
error[E0277]: cannot add `()` to `{integer}`
@@ -24,6 +28,10 @@ LL | 1 +
2428
<&'a f64 as Add<f64>>
2529
<&'a i128 as Add<i128>>
2630
<&'a i16 as Add<i16>>
31+
<&'a i32 as Add<i32>>
32+
<&'a i64 as Add<i64>>
33+
<&'a i8 as Add<i8>>
34+
<&'a isize as Add<isize>>
2735
and 48 others
2836

2937
error: aborting due to 2 previous errors

src/test/ui/issues/issue-24352.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ LL | 1.0f64 - 1
1010
<&f64 as Sub<&f64>>
1111
<f64 as Sub<&f64>>
1212
<f64 as Sub>
13+
<&'a f32 as Sub<f32>>
14+
<&'a i128 as Sub<i128>>
15+
<&'a i16 as Sub<i16>>
16+
<&'a i32 as Sub<i32>>
1317
and 48 others
1418
help: consider using a floating-point literal by writing it with `.0`
1519
|

src/test/ui/issues/issue-50582.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
1919
<&'a f64 as Add<f64>>
2020
<&'a i128 as Add<i128>>
2121
<&'a i16 as Add<i16>>
22+
<&'a i32 as Add<i32>>
23+
<&'a i64 as Add<i64>>
24+
<&'a i8 as Add<i8>>
25+
<&'a isize as Add<isize>>
2226
and 48 others
2327

2428
error: aborting due to 2 previous errors

src/test/ui/issues/issue-59488.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ LL | assert_eq!(Foo::Bar, i);
9999
<extern "C" fn(A) -> Ret as Debug>
100100
<extern "C" fn(A, ...) -> Ret as Debug>
101101
<extern "C" fn(A, B) -> Ret as Debug>
102+
<extern "C" fn(A, B, ...) -> Ret as Debug>
103+
<extern "C" fn(A, B, C) -> Ret as Debug>
104+
<extern "C" fn(A, B, C, ...) -> Ret as Debug>
105+
<extern "C" fn(A, B, C, D) -> Ret as Debug>
102106
and 68 others
103107
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
104108

src/test/ui/kindck/kindck-copy.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ LL | assert_copy::<&'static mut isize>();
99
<f32 as Copy>
1010
<f64 as Copy>
1111
<i128 as Copy>
12+
<i16 as Copy>
13+
<i32 as Copy>
14+
<i64 as Copy>
15+
<i8 as Copy>
1216
and 6 others
1317
note: required by a bound in `assert_copy`
1418
--> $DIR/kindck-copy.rs:5:18
@@ -27,6 +31,10 @@ LL | assert_copy::<&'a mut isize>();
2731
<f32 as Copy>
2832
<f64 as Copy>
2933
<i128 as Copy>
34+
<i16 as Copy>
35+
<i32 as Copy>
36+
<i64 as Copy>
37+
<i8 as Copy>
3038
and 6 others
3139
note: required by a bound in `assert_copy`
3240
--> $DIR/kindck-copy.rs:5:18

src/test/ui/lexer/lex-bad-char-literals-6.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ LL | if x == y {}
4343
<&'a str as PartialEq<String>>
4444
<&'b str as PartialEq<Cow<'a, str>>>
4545
<str as PartialEq<Cow<'a, str>>>
46+
<str as PartialEq<OsStr>>
47+
<str as PartialEq<OsString>>
48+
<str as PartialEq<String>>
49+
<str as PartialEq>
4650
and 4 others
4751

4852
error[E0308]: mismatched types
@@ -65,6 +69,10 @@ LL | if x == z {}
6569
<&'a str as PartialEq<String>>
6670
<&'b str as PartialEq<Cow<'a, str>>>
6771
<str as PartialEq<Cow<'a, str>>>
72+
<str as PartialEq<OsStr>>
73+
<str as PartialEq<OsString>>
74+
<str as PartialEq<String>>
75+
<str as PartialEq>
6876
and 4 others
6977

7078
error: aborting due to 6 previous errors

src/test/ui/mismatched_types/binops.stderr

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ LL | 1 + Some(1);
1010
<&'a f64 as Add<f64>>
1111
<&'a i128 as Add<i128>>
1212
<&'a i16 as Add<i16>>
13+
<&'a i32 as Add<i32>>
14+
<&'a i64 as Add<i64>>
15+
<&'a i8 as Add<i8>>
16+
<&'a isize as Add<isize>>
1317
and 48 others
1418

1519
error[E0277]: cannot subtract `Option<{integer}>` from `usize`
@@ -24,6 +28,10 @@ LL | 2 as usize - Some(1);
2428
<&usize as Sub<&usize>>
2529
<usize as Sub<&usize>>
2630
<usize as Sub>
31+
<&'a f32 as Sub<f32>>
32+
<&'a f64 as Sub<f64>>
33+
<&'a i128 as Sub<i128>>
34+
<&'a i16 as Sub<i16>>
2735
and 48 others
2836

2937
error[E0277]: cannot multiply `{integer}` by `()`
@@ -38,6 +46,10 @@ LL | 3 * ();
3846
<&'a f64 as Mul<f64>>
3947
<&'a i128 as Mul<i128>>
4048
<&'a i16 as Mul<i16>>
49+
<&'a i32 as Mul<i32>>
50+
<&'a i64 as Mul<i64>>
51+
<&'a i8 as Mul<i8>>
52+
<&'a isize as Mul<isize>>
4153
and 49 others
4254

4355
error[E0277]: cannot divide `{integer}` by `&str`
@@ -52,6 +64,10 @@ LL | 4 / "";
5264
<&'a f64 as Div<f64>>
5365
<&'a i128 as Div<i128>>
5466
<&'a i16 as Div<i16>>
67+
<&'a i32 as Div<i32>>
68+
<&'a i64 as Div<i64>>
69+
<&'a i8 as Div<i8>>
70+
<&'a isize as Div<isize>>
5571
and 54 others
5672

5773
error[E0277]: can't compare `{integer}` with `String`
@@ -66,6 +82,10 @@ LL | 5 < String::new();
6682
<f64 as PartialOrd>
6783
<i128 as PartialOrd>
6884
<i16 as PartialOrd>
85+
<i32 as PartialOrd>
86+
<i64 as PartialOrd>
87+
<i8 as PartialOrd>
88+
<isize as PartialOrd>
6989
and 6 others
7090

7191
error[E0277]: can't compare `{integer}` with `Result<{integer}, _>`
@@ -80,6 +100,10 @@ LL | 6 == Ok(1);
80100
<f64 as PartialEq>
81101
<i128 as PartialEq>
82102
<i16 as PartialEq>
103+
<i32 as PartialEq>
104+
<i64 as PartialEq>
105+
<i8 as PartialEq>
106+
<isize as PartialEq>
83107
and 6 others
84108

85109
error: aborting due to 6 previous errors

src/test/ui/never_type/issue-13352.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ LL | 2_usize + (loop {});
1010
<&usize as Add<&usize>>
1111
<usize as Add<&usize>>
1212
<usize as Add>
13+
<&'a f32 as Add<f32>>
14+
<&'a f64 as Add<f64>>
15+
<&'a i128 as Add<i128>>
16+
<&'a i16 as Add<i16>>
1317
and 48 others
1418

1519
error: aborting due to previous error

0 commit comments

Comments
 (0)