@@ -3021,10 +3021,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
3021
3021
let mut err = this. session . struct_span_err_with_code ( base_span, & base_msg, code) ;
3022
3022
3023
3023
// 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 ( ) )
3028
3025
&& this. self_value_is_available ( path[ 0 ] . span , span) {
3029
3026
err. span_suggestion_with_applicability (
3030
3027
span,
@@ -4377,10 +4374,9 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
4377
4374
where FilterFn : Fn ( Def ) -> bool
4378
4375
{
4379
4376
let mut candidates = Vec :: new ( ) ;
4380
- let mut worklist = Vec :: new ( ) ;
4381
4377
let mut seen_modules = FxHashSet ( ) ;
4382
4378
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) ] ;
4384
4380
4385
4381
while let Some ( ( in_module,
4386
4382
path_segments,
@@ -4467,13 +4463,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
4467
4463
-> Vec < ImportSuggestion >
4468
4464
where FilterFn : Fn ( Def ) -> bool
4469
4465
{
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) ;
4477
4468
4478
4469
if self . session . rust_2018 ( ) {
4479
4470
let extern_prelude_names = self . extern_prelude . clone ( ) ;
@@ -4502,9 +4493,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
4502
4493
-> Option < ( Module < ' a > , ImportSuggestion ) >
4503
4494
{
4504
4495
let mut result = None ;
4505
- let mut worklist = Vec :: new ( ) ;
4506
4496
let mut seen_modules = FxHashSet ( ) ;
4507
- worklist. push ( ( self . graph_root , Vec :: new ( ) ) ) ;
4497
+ let mut worklist = vec ! [ ( self . graph_root, Vec :: new( ) ) ] ;
4508
4498
4509
4499
while let Some ( ( in_module, path_segments) ) = worklist. pop ( ) {
4510
4500
// abort if the module is already found
0 commit comments