File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -473,16 +473,17 @@ impl<'tcx> TyCtxt<'tcx> {
473473 let mut seen = GrowableBitSet :: default ( ) ;
474474 for arg in substs {
475475 match arg. unpack ( ) {
476- GenericArgKind :: Lifetime ( lt) => {
477- if ignore_regions == CheckRegions :: OnlyEarlyBound {
478- let ty:: ReEarlyBound ( p) = lt. kind ( ) else {
479- return Err ( NotUniqueParam :: NotParam ( lt. into ( ) ) )
480- } ;
476+ GenericArgKind :: Lifetime ( lt) => match ( ignore_regions, lt. kind ( ) ) {
477+ ( CheckRegions :: OnlyEarlyBound , ty:: ReEarlyBound ( p) ) => {
481478 if !seen. insert ( p. index ) {
482479 return Err ( NotUniqueParam :: DuplicateParam ( lt. into ( ) ) ) ;
483480 }
484481 }
485- }
482+ ( CheckRegions :: OnlyEarlyBound , _) => {
483+ return Err ( NotUniqueParam :: NotParam ( lt. into ( ) ) ) ;
484+ }
485+ ( CheckRegions :: No , _) => { }
486+ } ,
486487 GenericArgKind :: Type ( t) => match t. kind ( ) {
487488 ty:: Param ( p) => {
488489 if !seen. insert ( p. index ) {
You can’t perform that action at this time.
0 commit comments