Rollup merge of #108161 - WaffleLapkin:const_param_ty, r=BoxyUwU

Add `ConstParamTy` trait

This is a bit sketch, but idk.
r? `@BoxyUwU`

Yet to be done:
- [x] ~~Figure out if it's okay to implement `StructuralEq` for primitives / possibly remove their special casing~~ (it should be okay, but maybe not in this PR...)
- [ ] Maybe refactor the code a little bit
- [x] Use a macro to make impls a bit nicer

Future work:
- [ ] Actually™ use the trait when checking if a `const` generic type is allowed
- [ ] _Really_ refactor the surrounding code
- [ ] Refactor `marker.rs` into multiple modules for each "theme" of markers
This commit is contained in:
Dylan DPC 2023-05-02 11:44:50 +05:30 committed by GitHub
commit b727132e23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 672 additions and 178 deletions

View file

@ -1385,7 +1385,9 @@ impl<'test> TestCx<'test> {
let actual_errors = json::parse_output(&diagnostic_file_name, &proc_res.stderr, proc_res);
let mut unexpected = Vec::new();
let mut found = vec![false; expected_errors.len()];
for actual_error in &actual_errors {
for mut actual_error in actual_errors {
actual_error.msg = self.normalize_output(&actual_error.msg, &[]);
let opt_index =
expected_errors.iter().enumerate().position(|(index, expected_error)| {
!found[index]
@ -1404,7 +1406,8 @@ impl<'test> TestCx<'test> {
None => {
// If the test is a known bug, don't require that the error is annotated
if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) {
if self.is_unexpected_compiler_message(&actual_error, expect_help, expect_note)
{
self.error(&format!(
"{}:{}: unexpected {}: '{}'",
file_name,