@@ -331,6 +331,52 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
331331 } )
332332 }
333333
334+ fn is_noise_0_7_0 (
335+ & self ,
336+ glob_binding : NameBinding < ' ra > ,
337+ old_glob_binding : NameBinding < ' ra > ,
338+ ) -> bool {
339+ let NameBindingKind :: Import { import : i1, .. } = glob_binding. kind else { unreachable ! ( ) } ;
340+ let NameBindingKind :: Import { import : i2, .. } = old_glob_binding. kind else {
341+ unreachable ! ( )
342+ } ;
343+ let [ seg1, seg2] = & i1. module_path [ ..] else { return false } ;
344+ if seg1. ident . name != kw:: SelfLower || seg2. ident . name . as_str ( ) != "perlin_surflet" {
345+ return false ;
346+ }
347+ let [ seg1, seg2] = & i2. module_path [ ..] else { return false } ;
348+ if seg1. ident . name != kw:: SelfLower || seg2. ident . name . as_str ( ) != "perlin" {
349+ return false ;
350+ }
351+ let Some ( def_id1) = glob_binding. res ( ) . opt_def_id ( ) else { return false } ;
352+ let Some ( def_id2) = old_glob_binding. res ( ) . opt_def_id ( ) else { return false } ;
353+ self . def_path_str ( def_id1) . ends_with ( "noise_fns::generators::perlin_surflet::Perlin" )
354+ && self . def_path_str ( def_id2) . ends_with ( "noise_fns::generators::perlin::Perlin" )
355+ }
356+
357+ fn is_rustybuzz_0_4_0 (
358+ & self ,
359+ glob_binding : NameBinding < ' ra > ,
360+ old_glob_binding : NameBinding < ' ra > ,
361+ ) -> bool {
362+ let NameBindingKind :: Import { import : i1, .. } = glob_binding. kind else { unreachable ! ( ) } ;
363+ let NameBindingKind :: Import { import : i2, .. } = old_glob_binding. kind else {
364+ unreachable ! ( )
365+ } ;
366+ let [ seg1, seg2] = & i1. module_path [ ..] else { return false } ;
367+ if seg1. ident . name != kw:: Super || seg2. ident . name . as_str ( ) != "gsubgpos" {
368+ return false ;
369+ }
370+ let [ seg1] = & i2. module_path [ ..] else { return false } ;
371+ if seg1. ident . name != kw:: Super {
372+ return false ;
373+ }
374+ let Some ( def_id1) = glob_binding. res ( ) . opt_def_id ( ) else { return false } ;
375+ let Some ( def_id2) = old_glob_binding. res ( ) . opt_def_id ( ) else { return false } ;
376+ self . def_path_str ( def_id1) . ends_with ( "tables::gsubgpos::Class" )
377+ && self . def_path_str ( def_id2) . ends_with ( "ggg::Class" )
378+ }
379+
334380 fn select_glob_binding (
335381 & self ,
336382 glob_binding : NameBinding < ' ra > ,
@@ -366,7 +412,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
366412 AmbiguityKind :: GlobVsGlob ,
367413 old_glob_binding,
368414 glob_binding,
369- false ,
415+ self . is_noise_0_7_0 ( glob_binding, old_glob_binding)
416+ || self . is_rustybuzz_0_4_0 ( glob_binding, old_glob_binding) ,
370417 )
371418 } else if !old_glob_binding. vis . is_at_least ( glob_binding. vis , self . tcx )
372419 || glob_binding. is_ambiguity_recursive ( )
0 commit comments