Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,13 @@ pub fn eval_config_entry(
sess: &Session,
cfg_entry: &CfgEntry,
id: NodeId,
features: Option<&Features>,
emit_lints: ShouldEmit,
) -> EvalConfigResult {
match cfg_entry {
CfgEntry::All(subs, ..) => {
let mut all = None;
for sub in subs {
let res = eval_config_entry(sess, sub, id, features, emit_lints);
let res = eval_config_entry(sess, sub, id, emit_lints);
// We cannot short-circuit because `eval_config_entry` emits some lints
if !res.as_bool() {
all.get_or_insert(res);
Expand All @@ -217,7 +216,7 @@ pub fn eval_config_entry(
CfgEntry::Any(subs, span) => {
let mut any = None;
for sub in subs {
let res = eval_config_entry(sess, sub, id, features, emit_lints);
let res = eval_config_entry(sess, sub, id, emit_lints);
// We cannot short-circuit because `eval_config_entry` emits some lints
if res.as_bool() {
any.get_or_insert(res);
Expand All @@ -229,7 +228,7 @@ pub fn eval_config_entry(
})
}
CfgEntry::Not(sub, span) => {
if eval_config_entry(sess, sub, id, features, emit_lints).as_bool() {
if eval_config_entry(sess, sub, id, emit_lints).as_bool() {
EvalConfigResult::False { reason: cfg_entry.clone(), reason_span: *span }
} else {
EvalConfigResult::True
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_builtin_macros/src/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pub(crate) fn expand_cfg(
cx.sess,
&cfg,
cx.current_expansion.lint_node_id,
Some(cx.ecfg.features),
ShouldEmit::ErrorsAndLints,
)
.as_bool();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3033,7 +3033,7 @@ fn add_dynamic_crate(cmd: &mut dyn Linker, sess: &Session, cratepath: &Path) {
fn relevant_lib(sess: &Session, lib: &NativeLib) -> bool {
match lib.cfg {
Some(ref cfg) => {
eval_config_entry(sess, cfg, CRATE_NODE_ID, None, ShouldEmit::ErrorsAndLints).as_bool()
eval_config_entry(sess, cfg, CRATE_NODE_ID, ShouldEmit::ErrorsAndLints).as_bool()
}
None => true,
}
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_expand/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ impl<'a> StripUnconfigured<'a> {
self.sess,
&cfg_predicate,
ast::CRATE_NODE_ID,
self.features,
ShouldEmit::ErrorsAndLints,
)
.as_bool()
Expand Down Expand Up @@ -443,7 +442,7 @@ impl<'a> StripUnconfigured<'a> {
return EvalConfigResult::True;
};

eval_config_entry(self.sess, &cfg, self.lint_node_id, self.features, emit_errors)
eval_config_entry(self.sess, &cfg, self.lint_node_id, emit_errors)
}

/// If attributes are not allowed on expressions, emit an error for `attr`
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/native_libs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub(crate) fn collect(tcx: TyCtxt<'_>, LocalCrate: LocalCrate) -> Vec<NativeLib>
pub(crate) fn relevant_lib(sess: &Session, lib: &NativeLib) -> bool {
match lib.cfg {
Some(ref cfg) => {
eval_config_entry(sess, cfg, CRATE_NODE_ID, None, ShouldEmit::ErrorsAndLints).as_bool()
eval_config_entry(sess, cfg, CRATE_NODE_ID, ShouldEmit::ErrorsAndLints).as_bool()
}
None => true,
}
Expand Down
Loading