@@ -3021,10 +3021,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
30213021 let mut err = this. session . struct_span_err_with_code ( base_span, & base_msg, code) ;
30223022
30233023 // Emit help message for fake-self from other languages like `this`(javascript)
3024- let fake_self: Vec < Ident > = [ "this" , "my" ] . iter ( ) . map (
3025- |s| Ident :: from_str ( * s)
3026- ) . collect ( ) ;
3027- if fake_self. contains ( & item_str)
3024+ if [ "this" , "my" ] . contains ( & & * item_str. as_str ( ) )
30283025 && this. self_value_is_available ( path[ 0 ] . span , span) {
30293026 err. span_suggestion_with_applicability (
30303027 span,
@@ -4377,10 +4374,9 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
43774374 where FilterFn : Fn ( Def ) -> bool
43784375 {
43794376 let mut candidates = Vec :: new ( ) ;
4380- let mut worklist = Vec :: new ( ) ;
43814377 let mut seen_modules = FxHashSet ( ) ;
43824378 let not_local_module = crate_name != keywords:: Crate . ident ( ) ;
4383- worklist. push ( ( start_module, Vec :: < ast:: PathSegment > :: new ( ) , not_local_module) ) ;
4379+ let mut worklist = vec ! [ ( start_module, Vec :: <ast:: PathSegment >:: new( ) , not_local_module) ] ;
43844380
43854381 while let Some ( ( in_module,
43864382 path_segments,
@@ -4467,13 +4463,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
44674463 -> Vec < ImportSuggestion >
44684464 where FilterFn : Fn ( Def ) -> bool
44694465 {
4470- let mut suggestions = vec ! [ ] ;
4471-
4472- suggestions. extend (
4473- self . lookup_import_candidates_from_module (
4474- lookup_name, namespace, self . graph_root , keywords:: Crate . ident ( ) , & filter_fn
4475- )
4476- ) ;
4466+ let mut suggestions = self . lookup_import_candidates_from_module (
4467+ lookup_name, namespace, self . graph_root , keywords:: Crate . ident ( ) , & filter_fn) ;
44774468
44784469 if self . session . rust_2018 ( ) {
44794470 let extern_prelude_names = self . extern_prelude . clone ( ) ;
@@ -4502,9 +4493,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
45024493 -> Option < ( Module < ' a > , ImportSuggestion ) >
45034494 {
45044495 let mut result = None ;
4505- let mut worklist = Vec :: new ( ) ;
45064496 let mut seen_modules = FxHashSet ( ) ;
4507- worklist. push ( ( self . graph_root , Vec :: new ( ) ) ) ;
4497+ let mut worklist = vec ! [ ( self . graph_root, Vec :: new( ) ) ] ;
45084498
45094499 while let Some ( ( in_module, path_segments) ) = worklist. pop ( ) {
45104500 // abort if the module is already found
0 commit comments