@@ -4707,18 +4707,20 @@ impl<'a> Resolver<'a> {
4707
4707
path : & Path ,
4708
4708
namespace : Namespace )
4709
4709
-> Option < ( Def , LastPrivate ) > {
4710
- let module_path_idents = path. segments . init ( ) . map ( |ps| ps. identifier ) ;
4710
+ let module_path_idents = path. segments . init ( ) . iter ( )
4711
+ . map ( |ps| ps. identifier )
4712
+ . collect :: < Vec < _ > > ( ) ;
4711
4713
4712
4714
let containing_module;
4713
4715
let last_private;
4714
4716
match self . resolve_module_path ( self . current_module ,
4715
- module_path_idents,
4717
+ module_path_idents. as_slice ( ) ,
4716
4718
UseLexicalScope ,
4717
4719
path. span ,
4718
4720
PathSearch ) {
4719
4721
Failed => {
4720
4722
let msg = format ! ( "use of undeclared module `{}`" ,
4721
- self . idents_to_str( module_path_idents) ) ;
4723
+ self . idents_to_str( module_path_idents. as_slice ( ) ) ) ;
4722
4724
self . resolve_error ( path. span , msg) ;
4723
4725
return None ;
4724
4726
}
@@ -4772,21 +4774,23 @@ impl<'a> Resolver<'a> {
4772
4774
path : & Path ,
4773
4775
namespace : Namespace )
4774
4776
-> Option < ( Def , LastPrivate ) > {
4775
- let module_path_idents = path. segments . init ( ) . map ( |ps| ps. identifier ) ;
4777
+ let module_path_idents = path. segments . init ( ) . iter ( )
4778
+ . map ( |ps| ps. identifier )
4779
+ . collect :: < Vec < _ > > ( ) ;
4776
4780
4777
4781
let root_module = self . graph_root . get_module ( ) ;
4778
4782
4779
4783
let containing_module;
4780
4784
let last_private;
4781
4785
match self . resolve_module_path_from_root ( root_module,
4782
- module_path_idents,
4786
+ module_path_idents. as_slice ( ) ,
4783
4787
0 ,
4784
4788
path. span ,
4785
4789
PathSearch ,
4786
4790
LastMod ( AllPublic ) ) {
4787
4791
Failed => {
4788
4792
let msg = format ! ( "use of undeclared module `::{}`" ,
4789
- self . idents_to_str( module_path_idents) ) ;
4793
+ self . idents_to_str( module_path_idents. as_slice ( ) ) ) ;
4790
4794
self . resolve_error ( path. span , msg) ;
4791
4795
return None ;
4792
4796
}
0 commit comments