File tree 1 file changed +6
-11
lines changed
compiler/rustc_middle/src/ty
1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -372,17 +372,12 @@ 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 ] )
378
- {
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 ;
375
+ if let Some ( inst) = param. default_value ( tcx) . map ( |default| default. instantiate ( tcx, args) ) {
376
+ if inst == args[ param. index as usize ] {
377
+ default_param_seen = true ;
378
+ } else if default_param_seen {
379
+ return true ;
380
+ }
386
381
}
387
382
}
388
383
false
You can’t perform that action at this time.
0 commit comments