@@ -1127,7 +1127,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
11271127 } ) ;
11281128
11291129 // Make sure error reporting is deterministic.
1130- suggestions. sort_by ( |a, b| a. candidate . as_str ( ) . partial_cmp ( b. candidate . as_str ( ) ) . unwrap ( ) ) ;
1130+ suggestions. sort_by ( |a, b| a. candidate . as_str ( ) . cmp ( b. candidate . as_str ( ) ) ) ;
11311131
11321132 match find_best_match_for_name (
11331133 & suggestions. iter ( ) . map ( |suggestion| suggestion. candidate ) . collect :: < Vec < Symbol > > ( ) ,
@@ -2256,14 +2256,15 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
22562256 mut path : Vec < Segment > ,
22572257 parent_scope : & ParentScope < ' ra > ,
22582258 ) -> Option < ( Vec < Segment > , Option < String > ) > {
2259- match ( path. get ( 0 ) , path . get ( 1 ) ) {
2259+ match path[ .. ] {
22602260 // `{{root}}::ident::...` on both editions.
22612261 // On 2015 `{{root}}` is usually added implicitly.
2262- ( Some ( fst ) , Some ( snd ) )
2263- if fst . ident . name == kw:: PathRoot && !snd . ident . is_path_segment_keyword ( ) => { }
2262+ [ first , second , .. ]
2263+ if first . ident . name == kw:: PathRoot && !second . ident . is_path_segment_keyword ( ) => { }
22642264 // `ident::...` on 2018.
2265- ( Some ( fst) , _)
2266- if fst. ident . span . at_least_rust_2018 ( ) && !fst. ident . is_path_segment_keyword ( ) =>
2265+ [ first, ..]
2266+ if first. ident . span . at_least_rust_2018 ( )
2267+ && !first. ident . is_path_segment_keyword ( ) =>
22672268 {
22682269 // Insert a placeholder that's later replaced by `self`/`super`/etc.
22692270 path. insert ( 0 , Segment :: from_ident ( Ident :: empty ( ) ) ) ;
@@ -2374,7 +2375,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
23742375 // 2) `std` suggestions before `core` suggestions.
23752376 let mut extern_crate_names =
23762377 self . extern_prelude . keys ( ) . map ( |ident| ident. name ) . collect :: < Vec < _ > > ( ) ;
2377- extern_crate_names. sort_by ( |a, b| b. as_str ( ) . partial_cmp ( a. as_str ( ) ) . unwrap ( ) ) ;
2378+ extern_crate_names. sort_by ( |a, b| b. as_str ( ) . cmp ( a. as_str ( ) ) ) ;
23782379
23792380 for name in extern_crate_names. into_iter ( ) {
23802381 // Replace first ident with a crate name and check if that is valid.
0 commit comments