1
Fork 0

Remove unused Span from the set function in State::Active.

This commit is contained in:
Nicholas Nethercote 2023-10-04 09:51:03 +11:00
parent 36aab8df0a
commit 53fe37de2e
3 changed files with 10 additions and 10 deletions

View file

@ -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),
}
}

View file

@ -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> },
}