File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
compiler/rustc_builtin_macros/src Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,21 @@ use crate::errors::{CfgSelectNoMatches, CfgSelectUnreachable};
1010
1111/// Selects the first arm whose predicate evaluates to true.
1212fn select_arm ( ecx : & ExtCtxt < ' _ > , branches : CfgSelectBranches ) -> Option < ( TokenStream , Span ) > {
13+ let mut result = None ;
1314 for ( cfg, tt, arm_span) in branches. reachable {
1415 if let EvalConfigResult :: True = attr:: eval_config_entry (
1516 & ecx. sess ,
1617 & cfg,
1718 ecx. current_expansion . lint_node_id ,
1819 ShouldEmit :: ErrorsAndLints ,
1920 ) {
20- return Some ( ( tt, arm_span) ) ;
21+ // FIXME(#149215) Ideally we should short-circuit here, but `eval_config_entry` currently emits lints so we cannot do this yet.
22+ result. get_or_insert ( ( tt, arm_span) ) ;
2123 }
2224 }
2325
24- branches. wildcard . map ( |( _, tt, span) | ( tt, span) )
26+ let wildcard = branches. wildcard . map ( |( _, tt, span) | ( tt, span) ) ;
27+ result. or ( wildcard)
2528}
2629
2730pub ( super ) fn expand_cfg_select < ' cx > (
You can’t perform that action at this time.
0 commit comments