Avoid decoding from metadata if not necessary
This commit is contained in:
parent
dff3e7ccd4
commit
9b040e92aa
1 changed files with 1 additions and 1 deletions
|
@ -130,9 +130,9 @@ impl DanglingPointerSearcher<'_, '_> {
|
|||
|
||||
fn lint_expr(cx: &LateContext<'_>, expr: &Expr<'_>) {
|
||||
if let ExprKind::MethodCall(method, receiver, _args, _span) = expr.kind
|
||||
&& is_temporary_rvalue(receiver)
|
||||
&& let Some(fn_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id)
|
||||
&& cx.tcx.has_attr(fn_id, sym::rustc_as_ptr)
|
||||
&& is_temporary_rvalue(receiver)
|
||||
&& let ty = cx.typeck_results().expr_ty(receiver)
|
||||
&& owns_allocation(cx.tcx, ty)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue