diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-06-04 19:50:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-04 19:50:27 +0200 |
| commit | e0815883cf5b3e749ce22a99f031a02e60db4f62 (patch) | |
| tree | 0f8106dc19dc89e76b5cc9ed260b41ea78cffb24 /compiler | |
| parent | 8375ab01b781b7cece564774df78785b1a432e6e (diff) | |
| parent | da2e33b4065c3356260a0c1671a945a3bf0a2f35 (diff) | |
Rollup merge of #142024 - m-ou-se:what-tail-expression, r=petrochenkov
Don't refer to 'this tail expression' in expansion. The user has no clue what the compiler is talking about when it says "this tail expression". It is an implementation detail of the macro that it uses a block with tail expression.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs index c4f1f7d712a..9c301373cf9 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -3841,7 +3841,9 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { .expr_ty_adjusted_opt(inner_expr) .unwrap_or(Ty::new_misc_error(tcx)); let span = inner_expr.span; - if Some(span) != err.span.primary_span() { + if Some(span) != err.span.primary_span() + && !span.in_external_macro(tcx.sess.source_map()) + { err.span_label( span, if ty.references_error() { |
