Skip to content

Commit

Permalink
Remove the symbol from ast::LitKind::Err.
Browse files Browse the repository at this point in the history
Because it's never used meaningfully.
  • Loading branch information
nnethercote committed Aug 23, 2022
1 parent 37eeed7 commit 06d7119
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/matches/match_same_arms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl<'a> NormalizedPat<'a> {
LitKind::Char(val) => Self::LitInt(val.into()),
LitKind::Int(val, _) => Self::LitInt(val),
LitKind::Bool(val) => Self::LitBool(val),
LitKind::Float(..) | LitKind::Err(_) => Self::Wild,
LitKind::Float(..) | LitKind::Err => Self::Wild,
},
_ => Self::Wild,
},
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
match lit.value.node {
LitKind::Bool(val) => kind!("Bool({val:?})"),
LitKind::Char(c) => kind!("Char({c:?})"),
LitKind::Err(val) => kind!("Err({val})"),
LitKind::Err => kind!("Err"),
LitKind::Byte(b) => kind!("Byte({b})"),
LitKind::Int(i, suffix) => {
let int_ty = match suffix {
Expand Down
8 changes: 3 additions & 5 deletions clippy_utils/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub enum Constant {
/// A reference
Ref(Box<Constant>),
/// A literal with syntax error.
Err(Symbol),
Err,
}

impl PartialEq for Constant {
Expand Down Expand Up @@ -118,9 +118,7 @@ impl Hash for Constant {
Self::Ref(ref r) => {
r.hash(state);
},
Self::Err(ref s) => {
s.hash(state);
},
Self::Err => {},
}
}
}
Expand Down Expand Up @@ -194,7 +192,7 @@ pub fn lit_to_mir_constant(lit: &LitKind, ty: Option<Ty<'_>>) -> Constant {
_ => bug!(),
},
LitKind::Bool(b) => Constant::Bool(b),
LitKind::Err(s) => Constant::Err(s),
LitKind::Err => Constant::Err,
}
}

Expand Down

0 comments on commit 06d7119

Please sign in to comment.