Skip to content

Commit ffe531a

Browse files
authored
Unrolled build for #157763
Rollup merge of #157763 - aerooneqq:delegation-pass-move-error, r=petrochenkov Move unused target expression error to appropriate place and rename it Small cleanup after #157601. r? @petrochenkov
2 parents b30f3df + 9c97a2d commit ffe531a

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_data_structures::fx::FxIndexMap;
2-
use rustc_macros::Diagnostic;
32
use rustc_middle::ty::TyCtxt;
4-
use rustc_span::Span;
3+
4+
use crate::errors::GlobOrListDelegationUnusedTargetExpr;
55

66
pub fn check_glob_and_list_delegations_target_expr(tcx: TyCtxt<'_>) {
77
let mut delegations_by_group_id = FxIndexMap::default();
@@ -19,14 +19,7 @@ pub fn check_glob_and_list_delegations_target_expr(tcx: TyCtxt<'_>) {
1919

2020
for (_, (unused_target_expr, span)) in delegations_by_group_id {
2121
if unused_target_expr {
22-
tcx.dcx().emit_err(DelegationTargetExprDeletedEverywhere { span });
22+
tcx.dcx().emit_err(GlobOrListDelegationUnusedTargetExpr { span });
2323
}
2424
}
2525
}
26-
27-
#[derive(Diagnostic)]
28-
#[diag("unused target expression is specified for glob or list delegation")]
29-
struct DelegationTargetExprDeletedEverywhere {
30-
#[primary_span]
31-
pub span: Span,
32-
}

compiler/rustc_passes/src/errors.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,3 +1260,10 @@ pub(crate) struct UnknownFormatParameterForOnUnimplementedAttr {
12601260
pub(crate) struct OnMoveMalformedFormatLiterals {
12611261
pub name: Symbol,
12621262
}
1263+
1264+
#[derive(Diagnostic)]
1265+
#[diag("unused target expression is specified for glob or list delegation")]
1266+
pub(crate) struct GlobOrListDelegationUnusedTargetExpr {
1267+
#[primary_span]
1268+
pub span: Span,
1269+
}

0 commit comments

Comments
 (0)