about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2023-05-02 11:44:50 +0530
committerGitHub <noreply@github.com>2023-05-02 11:44:50 +0530
commitb727132e23aaa4e80eb82816d95c20023940f916 (patch)
tree95fb9d868e6a15a303950217f2519a381bf5b805 /src
parentf916c44aecfc6c610f2d23cf929644aa08123547 (diff)
parentc31754651da17b207fa7fb94c2f3ba2c188aa0b1 (diff)
downloadrust-b727132e23aaa4e80eb82816d95c20023940f916.tar.gz
rust-b727132e23aaa4e80eb82816d95c20023940f916.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/tools/compiletest/src/runtest.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 0fd9f3ae3f4..a4be7af886b 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -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,