diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-04-25 08:07:44 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-05-12 10:26:50 +0000 |
| commit | 4e92f761fe54fc602ec2bf63819e8c973d1facd5 (patch) | |
| tree | ad4824e716785fd097f0c53e5ff4ce74c61770eb /compiler/rustc_ty_utils/src/errors.rs | |
| parent | 6ae803eedfeb57944cd0d2930d9a8b7a606baf4a (diff) | |
| download | rust-4e92f761fe54fc602ec2bf63819e8c973d1facd5.tar.gz rust-4e92f761fe54fc602ec2bf63819e8c973d1facd5.zip | |
Use the opaque_types_defined_by query to cheaply check for whether a hidden type may be registered for an opaque type
Diffstat (limited to 'compiler/rustc_ty_utils/src/errors.rs')
| -rw-r--r-- | compiler/rustc_ty_utils/src/errors.rs | 24 |
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, +} |
