Skip to content

Commit ed49307

Browse files
committed
Remove some type relating logic that has no tests
1 parent 07d0d7c commit ed49307

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

compiler/rustc_trait_selection/src/traits/auto_trait.rs

+3-36
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::traits::project::ProjectAndUnifyResult;
99

1010
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet, IndexEntry};
1111
use rustc_data_structures::unord::UnordSet;
12-
use rustc_infer::infer::DefineOpaqueTypes;
1312
use rustc_middle::mir::interpret::ErrorHandled;
1413
use rustc_middle::ty::{Region, RegionVid};
1514

@@ -762,42 +761,10 @@ impl<'tcx> AutoTraitFinder<'tcx> {
762761
_ => {}
763762
};
764763
}
765-
ty::PredicateKind::ConstEquate(c1, c2) => {
766-
let evaluate = |c: ty::Const<'tcx>| {
767-
if let ty::ConstKind::Unevaluated(unevaluated) = c.kind() {
768-
match selcx.infcx.const_eval_resolve(
769-
obligation.param_env,
770-
unevaluated,
771-
obligation.cause.span,
772-
) {
773-
Ok(Some(valtree)) => Ok(ty::Const::new_value(selcx.tcx(),valtree, c.ty())),
774-
Ok(None) => {
775-
let tcx = self.tcx;
776-
let reported =
777-
tcx.dcx().emit_err(UnableToConstructConstantValue {
778-
span: tcx.def_span(unevaluated.def),
779-
unevaluated: unevaluated,
780-
});
781-
Err(ErrorHandled::Reported(reported.into(), tcx.def_span(unevaluated.def)))
782-
}
783-
Err(err) => Err(err),
784-
}
785-
} else {
786-
Ok(c)
787-
}
788-
};
789764

790-
match (evaluate(c1), evaluate(c2)) {
791-
(Ok(c1), Ok(c2)) => {
792-
match selcx.infcx.at(&obligation.cause, obligation.param_env).eq(DefineOpaqueTypes::No,c1, c2)
793-
{
794-
Ok(_) => (),
795-
Err(_) => return false,
796-
}
797-
}
798-
_ => return false,
799-
}
800-
}
765+
// FIXME(generic_const_exprs): This code path doesn't affect any tests if it checks for equal
766+
// constants and avoids the early return that way.
767+
ty::PredicateKind::ConstEquate(..) => return false,
801768

802769
// There's not really much we can do with these predicates -
803770
// we start out with a `ParamEnv` with no inference variables,

0 commit comments

Comments
 (0)