string_slice should detect on Cow
This commit is contained in:
parent
5da97d006e
commit
7b7cf440cb
3 changed files with 16 additions and 5 deletions
|
|
@ -190,7 +190,7 @@ impl<'tcx> LateLintPass<'tcx> for StringAdd {
|
|||
}
|
||||
},
|
||||
ExprKind::Index(target, _idx, _) => {
|
||||
let e_ty = cx.typeck_results().expr_ty(target).peel_refs();
|
||||
let e_ty = cx.typeck_results().expr_ty_adjusted(target).peel_refs();
|
||||
if e_ty.is_str() || is_type_lang_item(cx, e_ty, LangItem::String) {
|
||||
span_lint(
|
||||
cx,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue