|
3 | 3 |
|
4 | 4 | use super::*; |
5 | 5 |
|
6 | | -use crate::errors::UnableToConstructConstantValue; |
7 | 6 | use crate::infer::region_constraints::{Constraint, RegionConstraintData}; |
8 | 7 | use crate::traits::project::ProjectAndUnifyResult; |
9 | 8 |
|
10 | 9 | use rustc_data_structures::fx::{FxIndexMap, FxIndexSet, IndexEntry}; |
11 | 10 | use rustc_data_structures::unord::UnordSet; |
12 | | -use rustc_infer::infer::DefineOpaqueTypes; |
13 | | -use rustc_middle::mir::interpret::ErrorHandled; |
14 | 11 | use rustc_middle::ty::{Region, RegionVid}; |
15 | 12 |
|
16 | 13 | use std::collections::VecDeque; |
@@ -762,42 +759,10 @@ impl<'tcx> AutoTraitFinder<'tcx> { |
762 | 759 | _ => {} |
763 | 760 | }; |
764 | 761 | } |
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 | | - }; |
789 | 762 |
|
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, |
801 | 766 |
|
802 | 767 | // There's not really much we can do with these predicates - |
803 | 768 | // we start out with a `ParamEnv` with no inference variables, |
|
0 commit comments