Change:
This code (): results in with missing const arguments in the at the bottom.
Hey guys could I take this on?
Just FYI, same problem with messages involving const generics and matches, e.g. () Also for functions: ()
Interestingly, when I use concrete types for the function example, things display properly: gives ()
you're welcome to look into fixing this! However, I'm not sure what might be causing this problem, so I don't have any suggestions for where to start looking yet.
I spent a few hours doing some digging and I can't find anything yet as well, though I'm as of yet still quite unfamiliar with the code-base. I might have more time tomorrow to look things over again, or maybe the day after.

Discussion:
.filter(|(a, b)| a == b) .count(); let len = sub1.len() - common_default_params; <ins> let consts_offset = len - sub1.consts().count(); </ins> // Only draw `<...>` if there're lifetime/type arguments. if len > 0 {

//         ^ elided type as this type argument was the same in both sides let type_arguments = sub1.types().zip(sub2.types()); let regions_len = sub1.regions().count(); <del> for (i, (ta1, ta2)) in type_arguments.take(len).enumerate() { </del> <ins> let num_display_types = consts_offset - regions_len; for (i, (ta1, ta2)) in type_arguments.take(num_display_types).enumerate() { </ins> let i = i + regions_len; if ta1 == ta2 { values.0.push_normal("_");

self.push_comma(&mut values.0, &mut values.1, len, i); } <ins> // Do the same for const arguments, if they are equal, do not highlight and // elide them from the output. let const_arguments = sub1.consts().zip(sub2.consts()); for (i, (ca1, ca2)) in const_arguments.enumerate() { let i = i + consts_offset; if ca1 == ca2 { values.0.push_normal("_"); values.1.push_normal("_"); } else { values.0.push_highlighted(ca1.to_string()); values.1.push_highlighted(ca2.to_string()); } self.push_comma(&mut values.0, &mut values.1, len, i); } </ins> // Close the type argument bracket. // Only draw `<...>` if there're lifetime/type arguments. if len > 0 {

LL |     let _: ConstString<"Hello"> = ConstString::<"World">; |                                   ^^^^^^^^^^^^^^^^^^^^^^ expected `"Hello"`, found `"World"` | <del> = note: expected type `ConstString<>` found type `ConstString<>` </del> <ins> = note: expected type `ConstString<"Hello">` found type `ConstString<"World">` </ins> error[E0308]: mismatched types --> $DIR/slice-const-param-mismatch.rs:11:33

LL |     let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">; |                                  ^^^^^^^^^^^^^^^^^^^^^ expected `"ℇ㇈↦"`, found `"ℇ㇈↥"` | <del> = note: expected type `ConstString<>` found type `ConstString<>` </del> <ins> = note: expected type `ConstString<"ℇ㇈↦">` found type `ConstString<"ℇ㇈↥">` </ins> error[E0308]: mismatched types --> $DIR/slice-const-param-mismatch.rs:13:33

LL |     let _: ConstBytes<b"AAA"> = ConstBytes::<b"BBB">; |                                 ^^^^^^^^^^^^^^^^^^^^ expected `b"AAA"`, found `b"BBB"` | <del> = note: expected type `ConstBytes<>` found type `ConstBytes<>` </del> <ins> = note: expected type `ConstBytes<b"AAA">` found type `ConstBytes<b"BBB">` </ins> error: aborting due to 3 previous errors

<ins> #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash // tests the diagnostic output of type mismatches for types that have const generics arguments. use std::marker::PhantomData; struct A<'a, T, const X: u32, const Y: u32> { data: PhantomData<&'a T> } fn a<'a, 'b>() { let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData }; //~^ ERROR mismatched types let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; //~^ ERROR mismatched types } pub fn main() {} </ins>

<ins> warning: the feature `const_generics` is incomplete and may cause the compiler to crash --> $DIR/types-mismatch-const-args.rs:1:12 | LL | #![feature(const_generics)] |            ^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:13:41 | LL |     let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData }; |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2u32`, found `4u32` | = note: expected type `A<'_, _, 2u32, _>` found type `A<'_, _, 4u32, _>` error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:15:41 | LL |     let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u16, found u32 | = note: expected type `A<'a, u16, _, _>` found type `A<'b, u32, _, _>` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. </ins>