We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b040e9 commit b6c80a6Copy full SHA for b6c80a6
compiler/rustc_lint/src/dangling.rs
@@ -131,10 +131,10 @@ impl DanglingPointerSearcher<'_, '_> {
131
fn lint_expr(cx: &LateContext<'_>, expr: &Expr<'_>) {
132
if let ExprKind::MethodCall(method, receiver, _args, _span) = expr.kind
133
&& is_temporary_rvalue(receiver)
134
- && let Some(fn_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id)
135
- && cx.tcx.has_attr(fn_id, sym::rustc_as_ptr)
136
&& let ty = cx.typeck_results().expr_ty(receiver)
137
&& owns_allocation(cx.tcx, ty)
+ && let Some(fn_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id)
+ && cx.tcx.has_attr(fn_id, sym::rustc_as_ptr)
138
{
139
// FIXME: use `emit_node_lint` when `#[primary_span]` is added.
140
cx.tcx.emit_node_span_lint(
0 commit comments