Skip to content

Commit 06d7119

Browse files
committed
Remove the symbol from ast::LitKind::Err.
Because it's never used meaningfully.
1 parent 37eeed7 commit 06d7119

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

clippy_lints/src/matches/match_same_arms.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl<'a> NormalizedPat<'a> {
290290
LitKind::Char(val) => Self::LitInt(val.into()),
291291
LitKind::Int(val, _) => Self::LitInt(val),
292292
LitKind::Bool(val) => Self::LitBool(val),
293-
LitKind::Float(..) | LitKind::Err(_) => Self::Wild,
293+
LitKind::Float(..) | LitKind::Err => Self::Wild,
294294
},
295295
_ => Self::Wild,
296296
},

clippy_lints/src/utils/author.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
276276
match lit.value.node {
277277
LitKind::Bool(val) => kind!("Bool({val:?})"),
278278
LitKind::Char(c) => kind!("Char({c:?})"),
279-
LitKind::Err(val) => kind!("Err({val})"),
279+
LitKind::Err => kind!("Err"),
280280
LitKind::Byte(b) => kind!("Byte({b})"),
281281
LitKind::Int(i, suffix) => {
282282
let int_ty = match suffix {

clippy_utils/src/consts.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub enum Constant {
4545
/// A reference
4646
Ref(Box<Constant>),
4747
/// A literal with syntax error.
48-
Err(Symbol),
48+
Err,
4949
}
5050

5151
impl PartialEq for Constant {
@@ -118,9 +118,7 @@ impl Hash for Constant {
118118
Self::Ref(ref r) => {
119119
r.hash(state);
120120
},
121-
Self::Err(ref s) => {
122-
s.hash(state);
123-
},
121+
Self::Err => {},
124122
}
125123
}
126124
}
@@ -194,7 +192,7 @@ pub fn lit_to_mir_constant(lit: &LitKind, ty: Option<Ty<'_>>) -> Constant {
194192
_ => bug!(),
195193
},
196194
LitKind::Bool(b) => Constant::Bool(b),
197-
LitKind::Err(s) => Constant::Err(s),
195+
LitKind::Err => Constant::Err,
198196
}
199197
}
200198

0 commit comments

Comments
 (0)