about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-10-04 09:51:03 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-10-05 10:18:29 +1100
commit53fe37de2e11537bf2953a29df3c5be8a8858850 (patch)
tree4efe83d18213618f342f9a65658999153e87a2a0
parent36aab8df0ab8a76f1c4f95ce8becefdd8a6fe526 (diff)
downloadrust-53fe37de2e11537bf2953a29df3c5be8a8858850.tar.gz
rust-53fe37de2e11537bf2953a29df3c5be8a8858850.zip
Remove unused `Span` from the `set` function in `State::Active`.
-rw-r--r--compiler/rustc_expand/src/config.rs8
-rw-r--r--compiler/rustc_feature/src/active.rs8
-rw-r--r--compiler/rustc_feature/src/lib.rs4
3 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs
index 8658cea137a..b2546caa345 100644
--- a/compiler/rustc_expand/src/config.rs
+++ b/compiler/rustc_expand/src/config.rs
@@ -23,7 +23,7 @@ use rustc_session::parse::feature_err;
 use rustc_session::Session;
 use rustc_span::edition::{Edition, ALL_EDITIONS};
 use rustc_span::symbol::{sym, Symbol};
-use rustc_span::{Span, DUMMY_SP};
+use rustc_span::Span;
 
 /// A folder that strips out items that do not belong in the current configuration.
 pub struct StripUnconfigured<'a> {
@@ -67,7 +67,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute]) -> Features {
     }
 
     for feature in active_features_up_to(crate_edition) {
-        feature.set(&mut features, DUMMY_SP);
+        feature.set(&mut features);
         edition_enabled_features.insert(feature.name, crate_edition);
     }
 
@@ -98,7 +98,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute]) -> Features {
                 for feature in active_features_up_to(edition) {
                     // FIXME(Manishearth) there is currently no way to set
                     // lib features by edition
-                    feature.set(&mut features, DUMMY_SP);
+                    feature.set(&mut features);
                     edition_enabled_features.insert(feature.name, edition);
                 }
             }
@@ -176,7 +176,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute]) -> Features {
             }
 
             if let Some(f) = ACTIVE_FEATURES.iter().find(|f| name == f.name) {
-                f.set(&mut features, mi.span());
+                f.set(&mut features);
                 features.declared_lang_features.push((name, mi.span(), None));
                 features.active_features.insert(name);
                 continue;
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs
index a02c04ecd3e..5173dc7ccaa 100644
--- a/compiler/rustc_feature/src/active.rs
+++ b/compiler/rustc_feature/src/active.rs
@@ -9,10 +9,10 @@ use rustc_span::Span;
 
 macro_rules! set {
     ($field: ident) => {{
-        fn f(features: &mut Features, _: Span) {
+        fn f(features: &mut Features) {
             features.$field = true;
         }
-        f as fn(&mut Features, Span)
+        f as fn(&mut Features)
     }};
 }
 
@@ -123,9 +123,9 @@ macro_rules! declare_features {
 
 impl Feature {
     /// Sets this feature in `Features`. Panics if called on a non-active feature.
-    pub fn set(&self, features: &mut Features, span: Span) {
+    pub fn set(&self, features: &mut Features) {
         match self.state {
-            State::Active { set } => set(features, span),
+            State::Active { set } => set(features),
             _ => panic!("called `set` on feature `{}` which is not `active`", self.name),
         }
     }
diff --git a/compiler/rustc_feature/src/lib.rs b/compiler/rustc_feature/src/lib.rs
index 69e33115922..b4933d6339c 100644
--- a/compiler/rustc_feature/src/lib.rs
+++ b/compiler/rustc_feature/src/lib.rs
@@ -23,14 +23,14 @@ mod removed;
 #[cfg(test)]
 mod tests;
 
-use rustc_span::{edition::Edition, symbol::Symbol, Span};
+use rustc_span::{edition::Edition, symbol::Symbol};
 use std::fmt;
 use std::num::NonZeroU32;
 
 #[derive(Clone, Copy)]
 pub enum State {
     Accepted,
-    Active { set: fn(&mut Features, Span) },
+    Active { set: fn(&mut Features) },
     Removed { reason: Option<&'static str> },
     Stabilized { reason: Option<&'static str> },
 }