File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -691,7 +691,16 @@ impl<ASTBuilder: ASTBuildable, HIRBuilder: Buildable>
691
691
return Ok ( ( ) ) ;
692
692
}
693
693
let path = Path :: new ( & __name__[ ..] ) ;
694
- let import_path = match cfg. input . resolve_path ( path, cfg) {
694
+ let resolved = if call. additional_operation ( ) . unwrap ( ) . is_erg_import ( ) {
695
+ cfg. input
696
+ . resolve_real_path ( path, cfg)
697
+ . or_else ( || cfg. input . resolve_decl_path ( path, cfg) )
698
+ } else {
699
+ cfg. input
700
+ . resolve_decl_path ( path, cfg)
701
+ . or_else ( || cfg. input . resolve_real_path ( path, cfg) )
702
+ } ;
703
+ let import_path = match resolved {
695
704
Some ( path) => path,
696
705
None if ERG_MODE => {
697
706
for _ in 0 ..600 {
Original file line number Diff line number Diff line change @@ -872,6 +872,22 @@ impl Accessor {
872
872
}
873
873
}
874
874
875
+ pub fn full_name ( & self ) -> Option < Str > {
876
+ match self {
877
+ Self :: Ident ( ident) => Some ( ident. inspect ( ) . clone ( ) ) ,
878
+ Self :: Attr ( attr) => Some (
879
+ format ! (
880
+ "{}{}{}" ,
881
+ attr. obj. full_name( ) ?,
882
+ attr. ident. vis,
883
+ attr. ident. inspect( )
884
+ )
885
+ . into ( ) ,
886
+ ) ,
887
+ _ => None ,
888
+ }
889
+ }
890
+
875
891
pub fn is_const ( & self ) -> bool {
876
892
match self {
877
893
Self :: Ident ( ident) => ident. is_const ( ) ,
@@ -6099,6 +6115,15 @@ impl Expr {
6099
6115
pub fn get_name ( & self ) -> Option < & Str > {
6100
6116
match self {
6101
6117
Expr :: Accessor ( acc) => acc. name ( ) ,
6118
+ Expr :: TypeAscription ( ascription) => ascription. expr . get_name ( ) ,
6119
+ _ => None ,
6120
+ }
6121
+ }
6122
+
6123
+ pub fn full_name ( & self ) -> Option < Str > {
6124
+ match self {
6125
+ Expr :: Accessor ( acc) => acc. full_name ( ) ,
6126
+ Expr :: TypeAscription ( ascription) => ascription. expr . full_name ( ) ,
6102
6127
_ => None ,
6103
6128
}
6104
6129
}
You can’t perform that action at this time.
0 commit comments