File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -659,8 +659,6 @@ impl<'a> Resolver<'a> {
659
659
return ;
660
660
}
661
661
662
- let via_import = name_binding. is_import ( ) && !name_binding. is_extern_crate ( ) ;
663
-
664
662
let child_accessible =
665
663
accessible && this. is_accessible_from ( name_binding. vis , parent_scope. module ) ;
666
664
@@ -669,6 +667,13 @@ impl<'a> Resolver<'a> {
669
667
return ;
670
668
}
671
669
670
+ let via_import = name_binding. is_import ( ) && !name_binding. is_extern_crate ( ) ;
671
+
672
+ // There is an assumption elsewhere that paths of variants are in the enum's
673
+ // declaration and not imported. With this assumption, the variant component is
674
+ // chopped and the rest of the path is assumed to be the enum's own path. For
675
+ // errors where a variant is used as the type instead of the enum, this causes
676
+ // funny looking invalid suggestions, i.e `foo` instead of `foo::MyEnum`.
672
677
if via_import && name_binding. is_possibly_imported_variant ( ) {
673
678
return ;
674
679
}
You can’t perform that action at this time.
0 commit comments