@@ -7,8 +7,8 @@ use rustc_data_structures::stack::ensure_sufficient_stack;
77use rustc_errors:: ErrorGuaranteed ;
88use rustc_hir:: def:: DefKind ;
99use rustc_hir:: lang_items:: LangItem ;
10+ use rustc_infer:: infer:: DefineOpaqueTypes ;
1011use rustc_infer:: infer:: resolve:: OpportunisticRegionResolver ;
11- use rustc_infer:: infer:: { DefineOpaqueTypes , RegionVariableOrigin } ;
1212use rustc_infer:: traits:: { ObligationCauseCode , PredicateObligations } ;
1313use rustc_middle:: traits:: select:: OverflowError ;
1414use rustc_middle:: traits:: { BuiltinImplSource , ImplSource , ImplSourceUserDefinedData } ;
@@ -18,8 +18,6 @@ use rustc_middle::ty::{
1818} ;
1919use rustc_middle:: { bug, span_bug} ;
2020use rustc_span:: sym;
21- use rustc_type_ir:: elaborate;
22- use thin_vec:: thin_vec;
2321use tracing:: { debug, instrument} ;
2422
2523use super :: {
@@ -63,9 +61,6 @@ enum ProjectionCandidate<'tcx> {
6361 /// Bounds specified on an object type
6462 Object ( ty:: PolyProjectionPredicate < ' tcx > ) ,
6563
66- /// Built-in bound for a dyn async fn in trait
67- ObjectRpitit ,
68-
6964 /// From an "impl" (or a "pseudo-impl" returned by select)
7065 Select ( Selection < ' tcx > ) ,
7166}
@@ -832,16 +827,6 @@ fn assemble_candidates_from_object_ty<'cx, 'tcx>(
832827 env_predicates,
833828 false ,
834829 ) ;
835-
836- // `dyn Trait` automagically project their AFITs to `dyn* Future`.
837- if tcx. is_impl_trait_in_trait ( obligation. predicate . def_id )
838- && let Some ( out_trait_def_id) = data. principal_def_id ( )
839- && let rpitit_trait_def_id = tcx. parent ( obligation. predicate . def_id )
840- && elaborate:: supertrait_def_ids ( tcx, out_trait_def_id)
841- . any ( |trait_def_id| trait_def_id == rpitit_trait_def_id)
842- {
843- candidate_set. push_candidate ( ProjectionCandidate :: ObjectRpitit ) ;
844- }
845830}
846831
847832#[ instrument(
@@ -1273,8 +1258,6 @@ fn confirm_candidate<'cx, 'tcx>(
12731258 ProjectionCandidate :: Select ( impl_source) => {
12741259 confirm_select_candidate ( selcx, obligation, impl_source)
12751260 }
1276-
1277- ProjectionCandidate :: ObjectRpitit => confirm_object_rpitit_candidate ( selcx, obligation) ,
12781261 } ;
12791262
12801263 // When checking for cycle during evaluation, we compare predicates with
@@ -2070,45 +2053,6 @@ fn confirm_impl_candidate<'cx, 'tcx>(
20702053 }
20712054}
20722055
2073- fn confirm_object_rpitit_candidate < ' cx , ' tcx > (
2074- selcx : & mut SelectionContext < ' cx , ' tcx > ,
2075- obligation : & ProjectionTermObligation < ' tcx > ,
2076- ) -> Progress < ' tcx > {
2077- let tcx = selcx. tcx ( ) ;
2078- let mut obligations = thin_vec ! [ ] ;
2079-
2080- // Compute an intersection lifetime for all the input components of this GAT.
2081- let intersection =
2082- selcx. infcx . next_region_var ( RegionVariableOrigin :: MiscVariable ( obligation. cause . span ) ) ;
2083- for component in obligation. predicate . args {
2084- match component. unpack ( ) {
2085- ty:: GenericArgKind :: Lifetime ( lt) => {
2086- obligations. push ( obligation. with ( tcx, ty:: OutlivesPredicate ( lt, intersection) ) ) ;
2087- }
2088- ty:: GenericArgKind :: Type ( ty) => {
2089- obligations. push ( obligation. with ( tcx, ty:: OutlivesPredicate ( ty, intersection) ) ) ;
2090- }
2091- ty:: GenericArgKind :: Const ( _ct) => {
2092- // Consts have no outlives...
2093- }
2094- }
2095- }
2096-
2097- Progress {
2098- term : Ty :: new_dynamic (
2099- tcx,
2100- tcx. item_bounds_to_existential_predicates (
2101- obligation. predicate . def_id ,
2102- obligation. predicate . args ,
2103- ) ,
2104- intersection,
2105- ty:: DynStar ,
2106- )
2107- . into ( ) ,
2108- obligations,
2109- }
2110- }
2111-
21122056// Get obligations corresponding to the predicates from the where-clause of the
21132057// associated type itself.
21142058fn assoc_ty_own_obligations < ' cx , ' tcx > (
0 commit comments