File tree 1 file changed +7
-10
lines changed
compiler/rustc_middle/src/ty
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -372,17 +372,14 @@ impl<'tcx> Generics {
372
372
) -> bool {
373
373
let mut default_param_seen = false ;
374
374
for param in self . params . iter ( ) {
375
- if param
376
- . default_value ( tcx)
377
- . is_some_and ( |default| default. instantiate ( tcx, args) == args[ param. index as usize ] )
375
+ if let Some ( inst) =
376
+ param. default_value ( tcx) . map ( |default| default. instantiate ( tcx, args) )
378
377
{
379
- default_param_seen = true ;
380
- } else if default_param_seen
381
- && param. default_value ( tcx) . is_some_and ( |default| {
382
- default. instantiate ( tcx, args) != args[ param. index as usize ]
383
- } )
384
- {
385
- return true ;
378
+ if inst == args[ param. index as usize ] {
379
+ default_param_seen = true ;
380
+ } else if default_param_seen {
381
+ return true ;
382
+ }
386
383
}
387
384
}
388
385
false
You can’t perform that action at this time.
0 commit comments