diff options
| author | lcnr <rust@lcnr.de> | 2025-04-01 23:34:00 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2025-04-03 11:13:10 +0200 |
| commit | 990201cb78a77ec0c148a880e6ab46bafa3468df (patch) | |
| tree | b022c760464855a607c1a657660ff33f5b1e6c37 /compiler/rustc_trait_selection/src/errors.rs | |
| parent | abc838be131d0ac1be3ce8a694a6056473f89619 (diff) | |
| download | rust-990201cb78a77ec0c148a880e6ab46bafa3468df.tar.gz rust-990201cb78a77ec0c148a880e6ab46bafa3468df.zip | |
move `check_opaque_type_parameter_valid`
Diffstat (limited to 'compiler/rustc_trait_selection/src/errors.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/errors.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs index b30390a9330..9f7bfe5101a 100644 --- a/compiler/rustc_trait_selection/src/errors.rs +++ b/compiler/rustc_trait_selection/src/errors.rs @@ -12,7 +12,7 @@ use rustc_hir::intravisit::{Visitor, VisitorExt, walk_ty}; use rustc_hir::{self as hir, AmbigArg, FnRetTy, GenericParamKind, IsAnonInPath, Node}; use rustc_macros::{Diagnostic, Subdiagnostic}; use rustc_middle::ty::print::{PrintTraitRefExt as _, TraitRefPrintOnlyTraitPath}; -use rustc_middle::ty::{self, Binder, ClosureKind, FnSig, Region, Ty, TyCtxt}; +use rustc_middle::ty::{self, Binder, ClosureKind, FnSig, GenericArg, Region, Ty, TyCtxt}; use rustc_span::{BytePos, Ident, Span, Symbol, kw}; use crate::error_reporting::infer::ObligationCauseAsDiagArg; @@ -1922,3 +1922,14 @@ impl Subdiagnostic for AddPreciseCapturingForOvercapture { } } } + +#[derive(Diagnostic)] +#[diag(trait_selection_opaque_type_non_generic_param, code = E0792)] +pub(crate) struct NonGenericOpaqueTypeParam<'a, 'tcx> { + pub ty: GenericArg<'tcx>, + pub kind: &'a str, + #[primary_span] + pub span: Span, + #[label] + pub param_span: Span, +} |
