@@ -4707,18 +4707,20 @@ impl<'a> Resolver<'a> {
47074707 path : & Path ,
47084708 namespace : Namespace )
47094709 -> 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 < _ > > ( ) ;
47114713
47124714 let containing_module;
47134715 let last_private;
47144716 match self . resolve_module_path ( self . current_module ,
4715- module_path_idents,
4717+ module_path_idents. as_slice ( ) ,
47164718 UseLexicalScope ,
47174719 path. span ,
47184720 PathSearch ) {
47194721 Failed => {
47204722 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 ( ) ) ) ;
47224724 self . resolve_error ( path. span , msg) ;
47234725 return None ;
47244726 }
@@ -4772,21 +4774,23 @@ impl<'a> Resolver<'a> {
47724774 path : & Path ,
47734775 namespace : Namespace )
47744776 -> 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 < _ > > ( ) ;
47764780
47774781 let root_module = self . graph_root . get_module ( ) ;
47784782
47794783 let containing_module;
47804784 let last_private;
47814785 match self . resolve_module_path_from_root ( root_module,
4782- module_path_idents,
4786+ module_path_idents. as_slice ( ) ,
47834787 0 ,
47844788 path. span ,
47854789 PathSearch ,
47864790 LastMod ( AllPublic ) ) {
47874791 Failed => {
47884792 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 ( ) ) ) ;
47904794 self . resolve_error ( path. span , msg) ;
47914795 return None ;
47924796 }
0 commit comments