diff options
| author | bors <bors@rust-lang.org> | 2022-10-01 17:11:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-01 17:11:19 +0000 |
| commit | 56a35bc906be1250a76fdb9a4b70e9261e10aec5 (patch) | |
| tree | fadad570b55acc7b2df2f40d110f6ecf0b54b36e /compiler/rustc_hir_analysis/src/check/expr.rs | |
| parent | edadc7ccdda644ef8149869d2f24018a1dac202a (diff) | |
| parent | 51e2f03af28c8e2a83a7cb51d8482297d8326260 (diff) | |
Auto merge of #102545 - matthiaskrgr:rollup-13i3tc3, r=matthiaskrgr
Rollup of 3 pull requests Successful merges: - #101675 (Improve `File::set_times` error handling) - #102500 (Remove `expr_parentheses_needed` from `ParseSess`) - #102533 (rustdoc: remove unused CSS selector `a.source`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/expr.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/expr.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/expr.rs b/compiler/rustc_hir_analysis/src/check/expr.rs index 48a4f40780b..09362eab673 100644 --- a/compiler/rustc_hir_analysis/src/check/expr.rs +++ b/compiler/rustc_hir_analysis/src/check/expr.rs @@ -41,6 +41,7 @@ use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase}; use rustc_middle::ty::error::TypeError::FieldMisMatch; use rustc_middle::ty::subst::SubstsRef; use rustc_middle::ty::{self, AdtKind, Ty, TypeVisitable}; +use rustc_session::errors::ExprParenthesesNeeded; use rustc_session::parse::feature_err; use rustc_span::hygiene::DesugaringKind; use rustc_span::lev_distance::find_best_match_for_name; @@ -394,7 +395,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if let Some(sp) = tcx.sess.parse_sess.ambiguous_block_expr_parse.borrow().get(&sp) { - tcx.sess.parse_sess.expr_parentheses_needed(&mut err, *sp); + err.subdiagnostic(ExprParenthesesNeeded::surrounding(*sp)); } err.emit(); oprnd_t = tcx.ty_error(); |
