11use rustc_ast:: tokenstream:: TokenStream ;
22use rustc_attr_parsing as attr;
3- use rustc_attr_parsing:: {
4- CfgSelectBranches , CfgSelectPredicate , EvalConfigResult , parse_cfg_select,
5- } ;
3+ use rustc_attr_parsing:: { CfgSelectBranches , EvalConfigResult , parse_cfg_select} ;
64use rustc_expand:: base:: { DummyResult , ExpandResult , ExtCtxt , MacroExpanderResult } ;
75use rustc_span:: { Ident , Span , sym} ;
86
9- use crate :: errors:: { CfgSelectNoMatches , CfgSelectUnreachable } ;
7+ use crate :: errors:: CfgSelectNoMatches ;
108
119/// Selects the first arm whose predicate evaluates to true.
1210fn select_arm ( ecx : & ExtCtxt < ' _ > , branches : CfgSelectBranches ) -> Option < ( TokenStream , Span ) > {
@@ -32,18 +30,6 @@ pub(super) fn expand_cfg_select<'cx>(
3230 ecx. current_expansion . lint_node_id ,
3331 ) {
3432 Ok ( branches) => {
35- if let Some ( ( underscore, _, _) ) = branches. wildcard {
36- // Warn for every unreachable predicate. We store the fully parsed branch for rustfmt.
37- for ( predicate, _, _) in & branches. unreachable {
38- let span = match predicate {
39- CfgSelectPredicate :: Wildcard ( underscore) => underscore. span ,
40- CfgSelectPredicate :: Cfg ( cfg) => cfg. span ( ) ,
41- } ;
42- let err = CfgSelectUnreachable { span, wildcard_span : underscore. span } ;
43- ecx. dcx ( ) . emit_warn ( err) ;
44- }
45- }
46-
4733 if let Some ( ( tts, arm_span) ) = select_arm ( ecx, branches) {
4834 return ExpandResult :: from_tts (
4935 ecx,
0 commit comments