File tree Expand file tree Collapse file tree
compiler/rustc_passes/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use rustc_data_structures:: fx:: FxIndexMap ;
2- use rustc_macros:: Diagnostic ;
32use rustc_middle:: ty:: TyCtxt ;
4- use rustc_span:: Span ;
3+
4+ use crate :: errors:: GlobOrListDelegationUnusedTargetExpr ;
55
66pub 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- }
Original file line number Diff line number Diff line change @@ -1260,3 +1260,10 @@ pub(crate) struct UnknownFormatParameterForOnUnimplementedAttr {
12601260pub ( 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+ }
You can’t perform that action at this time.
0 commit comments