@@ -153,7 +153,7 @@ fn check_addr_of_expr(
153
153
}
154
154
if let Some ( deref_trait_id) = cx. tcx . get_diagnostic_item ( sym:: Deref )
155
155
&& implements_trait ( cx, receiver_ty, deref_trait_id, & [ ] )
156
- && cx. get_associated_type ( receiver_ty, deref_trait_id, " Target" ) == Some ( target_ty)
156
+ && cx. get_associated_type ( receiver_ty, deref_trait_id, sym :: Target ) == Some ( target_ty)
157
157
// Make sure that it's actually calling the right `.to_string()`, (#10033)
158
158
// *or* this is a `Cow::into_owned()` call (which would be the wrong into_owned receiver (str != Cow)
159
159
// but that's ok for Cow::into_owned specifically)
@@ -322,7 +322,7 @@ fn check_split_call_arg(cx: &LateContext<'_>, expr: &Expr<'_>, method_name: Symb
322
322
// add `.as_ref()` to the suggestion.
323
323
let as_ref = if is_type_lang_item ( cx, cx. typeck_results ( ) . expr_ty ( expr) , LangItem :: String )
324
324
&& let Some ( deref_trait_id) = cx. tcx . get_diagnostic_item ( sym:: Deref )
325
- && cx. get_associated_type ( cx. typeck_results ( ) . expr_ty ( receiver) , deref_trait_id, " Target" )
325
+ && cx. get_associated_type ( cx. typeck_results ( ) . expr_ty ( receiver) , deref_trait_id, sym :: Target )
326
326
!= Some ( cx. tcx . types . str_ )
327
327
{
328
328
".as_ref()"
@@ -648,7 +648,7 @@ fn is_to_string_on_string_like<'a>(
648
648
&& let GenericArgKind :: Type ( ty) = generic_arg. unpack ( )
649
649
&& let Some ( deref_trait_id) = cx. tcx . get_diagnostic_item ( sym:: Deref )
650
650
&& let Some ( as_ref_trait_id) = cx. tcx . get_diagnostic_item ( sym:: AsRef )
651
- && ( cx. get_associated_type ( ty, deref_trait_id, " Target" ) == Some ( cx. tcx . types . str_ )
651
+ && ( cx. get_associated_type ( ty, deref_trait_id, sym :: Target ) == Some ( cx. tcx . types . str_ )
652
652
|| implements_trait ( cx, ty, as_ref_trait_id, & [ cx. tcx . types . str_ . into ( ) ] ) )
653
653
{
654
654
true
0 commit comments