Skip to content

Commit 5b51326

Browse files
Work around clippy bug in const-checking
I really hate having to do this, since I don't think unstable compiler APIs should have to work around misuse by external crates. However, this is the only way this change will pass CI without a ton of modifications to clippy and/or involvement of the clippy team.
1 parent 34b821f commit 5b51326

File tree

1 file changed

+5
-2
lines changed
  • compiler/rustc_mir/src/transform/check_consts

1 file changed

+5
-2
lines changed

compiler/rustc_mir/src/transform/check_consts/qualifs.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,11 @@ where
244244
};
245245

246246
// Check the qualifs of the value of `const` items.
247-
if let ty::ConstKind::Unevaluated(def, _, promoted) = constant.literal.val {
248-
assert!(promoted.is_none());
247+
if let ty::ConstKind::Unevaluated(def, _, _promoted) = constant.literal.val {
248+
// FIXME(rust-lang/rust-clippy#6080): Const-checking should never see promoteds, but clippy
249+
// is broken.
250+
// assert!(promoted.is_none());
251+
249252
// Don't peek inside trait associated constants.
250253
if cx.tcx.trait_of_item(def.did).is_none() {
251254
let qualifs = if let Some((did, param_did)) = def.as_const_arg() {

0 commit comments

Comments
 (0)