about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-14 20:00:22 +0100
committerGitHub <noreply@github.com>2024-03-14 20:00:22 +0100
commit6ce3110ce9d854bad8140e90f0cb166f1dd68c29 (patch)
tree6e22c1bba69f7cdd8936c77db6d97e492a8b2366 /compiler/rustc_errors/src
parent6366c64974cf1c70e25c4244abdd23c000a1603d (diff)
parent6e4cd8b7ccf12d6e4e97a44bbe4fd0093d12ca3d (diff)
downloadrust-6ce3110ce9d854bad8140e90f0cb166f1dd68c29.tar.gz
rust-6ce3110ce9d854bad8140e90f0cb166f1dd68c29.zip
Rollup merge of #122503 - compiler-errors:trait-alias-wf, r=Nilstrieb
Make `SubdiagMessageOp` well-formed

`WF(Diag<'_, G>)` requires `G: EmissionGuarantee`, but we don't currently check this is true due to limitations in the solver. Probably still worth enforcing.

r? `@nnethercote` (or anyone can r+ this, really)
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/diagnostic.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs
index 0c3e7fb75b0..5d345e788e9 100644
--- a/compiler/rustc_errors/src/diagnostic.rs
+++ b/compiler/rustc_errors/src/diagnostic.rs
@@ -189,7 +189,8 @@ where
     );
 }
 
-pub trait SubdiagMessageOp<G> = Fn(&mut Diag<'_, G>, SubdiagMessage) -> SubdiagMessage;
+pub trait SubdiagMessageOp<G: EmissionGuarantee> =
+    Fn(&mut Diag<'_, G>, SubdiagMessage) -> SubdiagMessage;
 
 /// Trait implemented by lint types. This should not be implemented manually. Instead, use
 /// `#[derive(LintDiagnostic)]` -- see [rustc_macros::LintDiagnostic].