@@ -80,7 +80,7 @@ use rustc_middle::lint::in_external_macro;
80
80
use rustc_middle:: ty:: { self , TraitRef , Ty , TyS } ;
81
81
use rustc_semver:: RustcVersion ;
82
82
use rustc_session:: { declare_tool_lint, impl_lint_pass} ;
83
- use rustc_span:: symbol:: SymbolStr ;
83
+ use rustc_span:: symbol:: Symbol ;
84
84
use rustc_span:: { sym, Span } ;
85
85
use rustc_typeck:: hir_ty_to_ty;
86
86
@@ -1997,21 +1997,21 @@ impl_lint_pass!(Methods => [
1997
1997
] ) ;
1998
1998
1999
1999
/// Extracts a method call name, args, and `Span` of the method name.
2000
- fn method_call < ' tcx > ( recv : & ' tcx hir:: Expr < ' tcx > ) -> Option < ( SymbolStr , & ' tcx [ hir:: Expr < ' tcx > ] , Span ) > {
2000
+ fn method_call < ' tcx > ( recv : & ' tcx hir:: Expr < ' tcx > ) -> Option < ( Symbol , & ' tcx [ hir:: Expr < ' tcx > ] , Span ) > {
2001
2001
if let ExprKind :: MethodCall ( path, span, args, _) = recv. kind {
2002
2002
if !args. iter ( ) . any ( |e| e. span . from_expansion ( ) ) {
2003
- return Some ( ( path. ident . name . as_str ( ) , args, span) ) ;
2003
+ return Some ( ( path. ident . name , args, span) ) ;
2004
2004
}
2005
2005
}
2006
2006
None
2007
2007
}
2008
2008
2009
- /// Same as `method_call` but the `SymbolStr ` is dereferenced into a temporary `&str`
2009
+ /// Same as `method_call` but the `Symbol ` is dereferenced into a temporary `&str`
2010
2010
macro_rules! method_call {
2011
2011
( $expr: expr) => {
2012
2012
method_call( $expr)
2013
2013
. as_ref( )
2014
- . map( |& ( ref name, args, span) | ( & * * name, args, span) )
2014
+ . map( |& ( ref name, args, span) | ( name. as_str ( ) , args, span) )
2015
2015
} ;
2016
2016
}
2017
2017
@@ -2028,8 +2028,8 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
2028
2028
from_iter_instead_of_collect:: check ( cx, expr, args, func) ;
2029
2029
} ,
2030
2030
hir:: ExprKind :: MethodCall ( method_call, ref method_span, args, _) => {
2031
- or_fun_call:: check ( cx, expr, * method_span, & method_call. ident . as_str ( ) , args) ;
2032
- expect_fun_call:: check ( cx, expr, * method_span, & method_call. ident . as_str ( ) , args) ;
2031
+ or_fun_call:: check ( cx, expr, * method_span, method_call. ident . as_str ( ) , args) ;
2032
+ expect_fun_call:: check ( cx, expr, * method_span, method_call. ident . as_str ( ) , args) ;
2033
2033
clone_on_copy:: check ( cx, expr, method_call. ident . name , args) ;
2034
2034
clone_on_ref_ptr:: check ( cx, expr, method_call. ident . name , args) ;
2035
2035
inefficient_to_string:: check ( cx, expr, method_call. ident . name , args) ;
@@ -2184,7 +2184,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
2184
2184
let self_ty = TraitRef :: identity( cx. tcx, item. def_id. to_def_id( ) ) . self_ty( ) . skip_binder( ) ;
2185
2185
wrong_self_convention:: check(
2186
2186
cx,
2187
- & item. ident. name. as_str( ) ,
2187
+ item. ident. name. as_str( ) ,
2188
2188
self_ty,
2189
2189
first_arg_ty,
2190
2190
first_arg_span,
0 commit comments