about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-13 05:52:50 +0000
committerbors <bors@rust-lang.org>2023-05-13 05:52:50 +0000
commit69fef92ab2f287f072b66fb7b4f62c8bb4acba43 (patch)
tree9c35e104a85958c2e5779572d67da3406f61a5b2 /compiler/rustc_ty_utils/src/errors.rs
parent16d3e18281fde75eb6c62ebb8363af28de8a3ef0 (diff)
parent1533eafa15942f9e66a28a19baa492b2ce6126c4 (diff)
downloadrust-69fef92ab2f287f072b66fb7b4f62c8bb4acba43.tar.gz
rust-69fef92ab2f287f072b66fb7b4f62c8bb4acba43.zip
Auto merge of #111526 - Dylan-DPC:rollup-h75agro, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #110454 (Require impl Trait in associated types to appear in method signatures)
 - #111096 (Add support for `cfg(overflow_checks)`)
 - #111451 (Note user-facing types of coercion failure)
 - #111469 (Fix data race in llvm source code coverage)
 - #111494 (Encode `VariantIdx` so we can decode ADT variants in the right order)
 - #111499 (asm: loongarch64: Drop efiapi)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_ty_utils/src/errors.rs')
-rw-r--r--compiler/rustc_ty_utils/src/errors.rs24
1 files changed, 23 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/errors.rs b/compiler/rustc_ty_utils/src/errors.rs
index 3d3fc50e6e5..553bf40ef3a 100644
--- a/compiler/rustc_ty_utils/src/errors.rs
+++ b/compiler/rustc_ty_utils/src/errors.rs
@@ -1,7 +1,7 @@
 //! Errors emitted by ty_utils
 
 use rustc_macros::{Diagnostic, Subdiagnostic};
-use rustc_middle::ty::Ty;
+use rustc_middle::ty::{GenericArg, Ty};
 use rustc_span::Span;
 
 #[derive(Diagnostic)]
@@ -100,3 +100,25 @@ pub struct NonPrimitiveSimdType<'tcx> {
     pub ty: Ty<'tcx>,
     pub e_ty: Ty<'tcx>,
 }
+
+#[derive(Diagnostic)]
+#[diag(ty_utils_impl_trait_duplicate_arg)]
+pub struct DuplicateArg<'tcx> {
+    pub arg: GenericArg<'tcx>,
+    #[primary_span]
+    #[label]
+    pub span: Span,
+    #[note]
+    pub opaque_span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(ty_utils_impl_trait_not_param)]
+pub struct NotParam<'tcx> {
+    pub arg: GenericArg<'tcx>,
+    #[primary_span]
+    #[label]
+    pub span: Span,
+    #[note]
+    pub opaque_span: Span,
+}