Skip to content

Commit 74e90d8

Browse files
authored
Rollup merge of #148688 - JonathanBrouwer:remove_features, r=jdonszelmann
Remove unused argument `features` from `eval_config_entry`
2 parents 784e91d + c52b703 commit 74e90d8

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

compiler/rustc_attr_parsing/src/attributes/cfg.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,13 @@ pub fn eval_config_entry(
199199
sess: &Session,
200200
cfg_entry: &CfgEntry,
201201
id: NodeId,
202-
features: Option<&Features>,
203202
emit_lints: ShouldEmit,
204203
) -> EvalConfigResult {
205204
match cfg_entry {
206205
CfgEntry::All(subs, ..) => {
207206
let mut all = None;
208207
for sub in subs {
209-
let res = eval_config_entry(sess, sub, id, features, emit_lints);
208+
let res = eval_config_entry(sess, sub, id, emit_lints);
210209
// We cannot short-circuit because `eval_config_entry` emits some lints
211210
if !res.as_bool() {
212211
all.get_or_insert(res);
@@ -217,7 +216,7 @@ pub fn eval_config_entry(
217216
CfgEntry::Any(subs, span) => {
218217
let mut any = None;
219218
for sub in subs {
220-
let res = eval_config_entry(sess, sub, id, features, emit_lints);
219+
let res = eval_config_entry(sess, sub, id, emit_lints);
221220
// We cannot short-circuit because `eval_config_entry` emits some lints
222221
if res.as_bool() {
223222
any.get_or_insert(res);
@@ -229,7 +228,7 @@ pub fn eval_config_entry(
229228
})
230229
}
231230
CfgEntry::Not(sub, span) => {
232-
if eval_config_entry(sess, sub, id, features, emit_lints).as_bool() {
231+
if eval_config_entry(sess, sub, id, emit_lints).as_bool() {
233232
EvalConfigResult::False { reason: cfg_entry.clone(), reason_span: *span }
234233
} else {
235234
EvalConfigResult::True

compiler/rustc_builtin_macros/src/cfg.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub(crate) fn expand_cfg(
3030
cx.sess,
3131
&cfg,
3232
cx.current_expansion.lint_node_id,
33-
Some(cx.ecfg.features),
3433
ShouldEmit::ErrorsAndLints,
3534
)
3635
.as_bool();

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3036,7 +3036,7 @@ fn add_dynamic_crate(cmd: &mut dyn Linker, sess: &Session, cratepath: &Path) {
30363036
fn relevant_lib(sess: &Session, lib: &NativeLib) -> bool {
30373037
match lib.cfg {
30383038
Some(ref cfg) => {
3039-
eval_config_entry(sess, cfg, CRATE_NODE_ID, None, ShouldEmit::ErrorsAndLints).as_bool()
3039+
eval_config_entry(sess, cfg, CRATE_NODE_ID, ShouldEmit::ErrorsAndLints).as_bool()
30403040
}
30413041
None => true,
30423042
}

compiler/rustc_expand/src/config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ impl<'a> StripUnconfigured<'a> {
322322
self.sess,
323323
&cfg_predicate,
324324
ast::CRATE_NODE_ID,
325-
self.features,
326325
ShouldEmit::ErrorsAndLints,
327326
)
328327
.as_bool()
@@ -443,7 +442,7 @@ impl<'a> StripUnconfigured<'a> {
443442
return EvalConfigResult::True;
444443
};
445444

446-
eval_config_entry(self.sess, &cfg, self.lint_node_id, self.features, emit_errors)
445+
eval_config_entry(self.sess, &cfg, self.lint_node_id, emit_errors)
447446
}
448447

449448
/// If attributes are not allowed on expressions, emit an error for `attr`

compiler/rustc_metadata/src/native_libs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub(crate) fn collect(tcx: TyCtxt<'_>, LocalCrate: LocalCrate) -> Vec<NativeLib>
189189
pub(crate) fn relevant_lib(sess: &Session, lib: &NativeLib) -> bool {
190190
match lib.cfg {
191191
Some(ref cfg) => {
192-
eval_config_entry(sess, cfg, CRATE_NODE_ID, None, ShouldEmit::ErrorsAndLints).as_bool()
192+
eval_config_entry(sess, cfg, CRATE_NODE_ID, ShouldEmit::ErrorsAndLints).as_bool()
193193
}
194194
None => true,
195195
}

0 commit comments

Comments
 (0)