Skip to content

Commit fbb71a9

Browse files
committed
Remove superfluous check that was causing test failure
Boxy confirmed that this is unnecessary (and incorrect now that we have const paths).
1 parent 1607c5f commit fbb71a9

File tree

1 file changed

+1
-4
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+1
-4
lines changed

compiler/rustc_trait_selection/src/traits/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use std::fmt::Debug;
2727
use std::ops::ControlFlow;
2828

2929
use rustc_errors::ErrorGuaranteed;
30-
use rustc_hir::def::DefKind;
3130
pub use rustc_infer::traits::*;
3231
use rustc_middle::query::Providers;
3332
use rustc_middle::span_bug;
@@ -372,9 +371,7 @@ pub fn normalize_param_env_or_error<'tcx>(
372371
// should actually be okay since without `feature(generic_const_exprs)` the only
373372
// const arguments that have a non-empty param env are array repeat counts. These
374373
// do not appear in the type system though.
375-
if let ty::ConstKind::Unevaluated(uv) = c.kind()
376-
&& self.0.def_kind(uv.def) == DefKind::AnonConst
377-
{
374+
if let ty::ConstKind::Unevaluated(_) = c.kind() {
378375
let infcx = self.0.infer_ctxt().build(TypingMode::non_body_analysis());
379376
let c = evaluate_const(&infcx, c, ty::ParamEnv::empty());
380377
// We should never wind up with any `infcx` local state when normalizing anon consts

0 commit comments

Comments
 (0)