@@ -1752,7 +1752,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1752
1752
} ) ;
1753
1753
self . infcx
1754
1754
. at ( & obligation. cause , obligation. param_env )
1755
- . define_opaque_types ( false )
1756
1755
. sup ( ty:: Binder :: dummy ( placeholder_trait_ref) , trait_bound)
1757
1756
. map ( |InferOk { obligations : _, value : ( ) } | {
1758
1757
// This method is called within a probe, so we can't have
@@ -1815,7 +1814,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1815
1814
let is_match = self
1816
1815
. infcx
1817
1816
. at ( & obligation. cause , obligation. param_env )
1818
- . define_opaque_types ( false )
1819
1817
. sup ( obligation. predicate , infer_projection)
1820
1818
. map_or ( false , |InferOk { obligations, value : ( ) } | {
1821
1819
self . evaluate_predicates_recursively (
@@ -2507,7 +2505,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2507
2505
let InferOk { obligations, .. } = self
2508
2506
. infcx
2509
2507
. at ( & cause, obligation. param_env )
2510
- . define_opaque_types ( false )
2511
2508
. eq ( placeholder_obligation_trait_ref, impl_trait_ref)
2512
2509
. map_err ( |e| {
2513
2510
debug ! ( "match_impl: failed eq_trait_refs due to `{}`" , e. to_string( self . tcx( ) ) )
@@ -2558,11 +2555,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2558
2555
) -> Result < Vec < PredicateObligation < ' tcx > > , ( ) > {
2559
2556
self . infcx
2560
2557
. at ( & obligation. cause , obligation. param_env )
2561
- // We don't want predicates for opaque types to just match all other types,
2562
- // if there is an obligation on the opaque type, then that obligation must be met
2563
- // opaquely. Otherwise we'd match any obligation to the opaque type and then error
2564
- // out later.
2565
- . define_opaque_types ( false )
2566
2558
. sup ( obligation. predicate . to_poly_trait_ref ( ) , poly_trait_ref)
2567
2559
. map ( |InferOk { obligations, .. } | obligations)
2568
2560
. map_err ( |_| ( ) )
0 commit comments