1
Fork 0

Rollup merge of #114779 - MU001999:fix/114701, r=petrochenkov

Add check before suggest removing parens

Fixes #114701
This commit is contained in:
Matthias Krüger 2023-08-16 08:43:51 +02:00 committed by GitHub
commit 8f1c8116f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 0 deletions

View file

@ -599,6 +599,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
= self.typeck_results.borrow().qpath_res(qpath, callee_expr.hir_id)
// Only suggest removing parens if there are no arguments
&& arg_exprs.is_empty()
&& call_expr.span.contains(callee_expr.span)
{
let descr = match kind {
def::CtorOf::Struct => "struct",