File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
rustc_error_messages/locales/en-US Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -127,3 +127,5 @@ typeck-manual-implementation =
127127 manual implementations of `{ $trait_name } ` are experimental
128128 .label = manual implementations of `{ $trait_name } ` are experimental
129129 .help = add `#![feature(unboxed_closures)]` to the crate attributes to enable
130+
131+ typeck-substs-on-overridden-impl = could not resolve substs on overridden impl
Original file line number Diff line number Diff line change @@ -323,3 +323,10 @@ pub struct ManualImplementation {
323323 pub span : Span ,
324324 pub trait_name : String ,
325325}
326+
327+ #[ derive( SessionDiagnostic ) ]
328+ #[ error( slug = "typeck-substs-on-overridden-impl" ) ]
329+ pub struct SubstsOnOverriddenImpl {
330+ #[ primary_span]
331+ pub span : Span ,
332+ }
Original file line number Diff line number Diff line change 6666//! on traits with methods can.
6767
6868use crate :: constrained_generic_params as cgp;
69+ use crate :: errors:: SubstsOnOverriddenImpl ;
6970
7071use rustc_data_structures:: fx:: FxHashSet ;
7172use rustc_hir:: def_id:: { DefId , LocalDefId } ;
@@ -165,7 +166,7 @@ fn get_impl_substs<'tcx>(
165166 let outlives_env = OutlivesEnvironment :: new ( ty:: ParamEnv :: empty ( ) ) ;
166167 infcx. resolve_regions_and_report_errors ( impl1_def_id, & outlives_env, RegionckMode :: default ( ) ) ;
167168 let Ok ( impl2_substs) = infcx. fully_resolve ( impl2_substs) else {
168- tcx. sess . struct_span_err ( span , "could not resolve substs on overridden impl" ) . emit ( ) ;
169+ tcx. sess . emit_err ( SubstsOnOverriddenImpl { span } ) ;
169170 return None ;
170171 } ;
171172 Some ( ( impl1_substs, impl2_substs) )
You can’t perform that action at this time.
0 commit comments