Remove unused Span
from the set
function in State::Active
.
This commit is contained in:
parent
36aab8df0a
commit
53fe37de2e
3 changed files with 10 additions and 10 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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> },
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue