Skip to content

Commit c510140

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

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

compiler/rustc_trait_selection/src/traits/auto_trait.rs

+3-38
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
44
use super::*;
55

6-
use crate::errors::UnableToConstructConstantValue;
76
use crate::infer::region_constraints::{Constraint, RegionConstraintData};
87
use crate::traits::project::ProjectAndUnifyResult;
98

109
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet, IndexEntry};
1110
use rustc_data_structures::unord::UnordSet;
12-
use rustc_infer::infer::DefineOpaqueTypes;
13-
use rustc_middle::mir::interpret::ErrorHandled;
1411
use rustc_middle::ty::{Region, RegionVid};
1512

1613
use std::collections::VecDeque;
@@ -762,42 +759,10 @@ impl<'tcx> AutoTraitFinder<'tcx> {
762759
_ => {}
763760
};
764761
}
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-
};
789762

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-
}
763+
// FIXME(generic_const_exprs): This code path doesn't affect any tests if it checks for equal
764+
// constants and avoids the early return that way.
765+
ty::PredicateKind::ConstEquate(..) => return false,
801766

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

0 commit comments

Comments
 (0)