@@ -402,13 +402,16 @@ fn classify_group(
402402 // leftover under a retired one is moving, not living in the retired one
403403 // -- calling that "deprecated location" would overstate it.
404404 let mut live: Vec < String > = Vec :: new ( ) ;
405- let mut retired: Vec < String > = Vec :: new ( ) ;
405+ let mut retired: Vec < ( String , & Deprecation ) > = Vec :: new ( ) ;
406406 for alternative in alternatives. iter ( ) . filter ( |path| !path. ends_with ( '/' ) ) {
407407 let basename = basename ( alternative) ;
408408 for file in files. iter ( ) . filter ( |file| basename_of ( file) == basename) {
409- if is_retired ( file, deprecations) {
410- if !retired. contains ( file) {
411- retired. push ( file. clone ( ) ) ;
409+ if let Some ( deprecation) = deprecations
410+ . iter ( )
411+ . find ( |deprecation| deprecation. matches ( file) )
412+ {
413+ if !retired. iter ( ) . any ( |( path, _) | path == file) {
414+ retired. push ( ( file. clone ( ) , deprecation) ) ;
412415 }
413416 } else if !live. contains ( file) {
414417 live. push ( file. clone ( ) ) ;
@@ -420,16 +423,12 @@ fn classify_group(
420423 return GroupVerdict :: Elsewhere {
421424 expected : alternatives. to_vec ( ) ,
422425 found : live,
423- deprecated_copies : retired,
426+ deprecated_copies : retired. into_iter ( ) . map ( | ( path , _ ) | path ) . collect ( ) ,
424427 } ;
425428 }
426429
427430 // 4. Present only under a location the canon has retired.
428- if let Some ( found) = retired. first ( ) {
429- let deprecated = deprecations
430- . iter ( )
431- . find ( |deprecated| deprecated. matches ( found) )
432- . expect ( "a retired path came from a deprecation" ) ;
431+ if let Some ( ( found, deprecated) ) = retired. first ( ) {
433432 return GroupVerdict :: Deprecated {
434433 found : found. clone ( ) ,
435434 location : deprecated. location . clone ( ) ,
0 commit comments