File tree 3 files changed +11
-1
lines changed
rustc_error_messages/locales/en-US
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -127,3 +127,5 @@ typeck-manual-implementation =
127
127
manual implementations of `{ $trait_name } ` are experimental
128
128
.label = manual implementations of `{ $trait_name } ` are experimental
129
129
.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 {
323
323
pub span : Span ,
324
324
pub trait_name : String ,
325
325
}
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 66
66
//! on traits with methods can.
67
67
68
68
use crate :: constrained_generic_params as cgp;
69
+ use crate :: errors:: SubstsOnOverriddenImpl ;
69
70
70
71
use rustc_data_structures:: fx:: FxHashSet ;
71
72
use rustc_hir:: def_id:: { DefId , LocalDefId } ;
@@ -165,7 +166,7 @@ fn get_impl_substs<'tcx>(
165
166
let outlives_env = OutlivesEnvironment :: new ( ty:: ParamEnv :: empty ( ) ) ;
166
167
infcx. resolve_regions_and_report_errors ( impl1_def_id, & outlives_env, RegionckMode :: default ( ) ) ;
167
168
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 } ) ;
169
170
return None ;
170
171
} ;
171
172
Some ( ( impl1_substs, impl2_substs) )
You can’t perform that action at this time.
0 commit comments