@@ -7,8 +7,8 @@ use rustc_data_structures::stack::ensure_sufficient_stack;
7
7
use rustc_errors:: ErrorGuaranteed ;
8
8
use rustc_hir:: def:: DefKind ;
9
9
use rustc_hir:: lang_items:: LangItem ;
10
+ use rustc_infer:: infer:: DefineOpaqueTypes ;
10
11
use rustc_infer:: infer:: resolve:: OpportunisticRegionResolver ;
11
- use rustc_infer:: infer:: { DefineOpaqueTypes , RegionVariableOrigin } ;
12
12
use rustc_infer:: traits:: { ObligationCauseCode , PredicateObligations } ;
13
13
use rustc_middle:: traits:: select:: OverflowError ;
14
14
use rustc_middle:: traits:: { BuiltinImplSource , ImplSource , ImplSourceUserDefinedData } ;
@@ -18,8 +18,6 @@ use rustc_middle::ty::{
18
18
} ;
19
19
use rustc_middle:: { bug, span_bug} ;
20
20
use rustc_span:: sym;
21
- use rustc_type_ir:: elaborate;
22
- use thin_vec:: thin_vec;
23
21
use tracing:: { debug, instrument} ;
24
22
25
23
use super :: {
@@ -63,9 +61,6 @@ enum ProjectionCandidate<'tcx> {
63
61
/// Bounds specified on an object type
64
62
Object ( ty:: PolyProjectionPredicate < ' tcx > ) ,
65
63
66
- /// Built-in bound for a dyn async fn in trait
67
- ObjectRpitit ,
68
-
69
64
/// From an "impl" (or a "pseudo-impl" returned by select)
70
65
Select ( Selection < ' tcx > ) ,
71
66
}
@@ -832,16 +827,6 @@ fn assemble_candidates_from_object_ty<'cx, 'tcx>(
832
827
env_predicates,
833
828
false ,
834
829
) ;
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
- }
845
830
}
846
831
847
832
#[ instrument(
@@ -1273,8 +1258,6 @@ fn confirm_candidate<'cx, 'tcx>(
1273
1258
ProjectionCandidate :: Select ( impl_source) => {
1274
1259
confirm_select_candidate ( selcx, obligation, impl_source)
1275
1260
}
1276
-
1277
- ProjectionCandidate :: ObjectRpitit => confirm_object_rpitit_candidate ( selcx, obligation) ,
1278
1261
} ;
1279
1262
1280
1263
// When checking for cycle during evaluation, we compare predicates with
@@ -2070,45 +2053,6 @@ fn confirm_impl_candidate<'cx, 'tcx>(
2070
2053
}
2071
2054
}
2072
2055
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
-
2112
2056
// Get obligations corresponding to the predicates from the where-clause of the
2113
2057
// associated type itself.
2114
2058
fn assoc_ty_own_obligations < ' cx , ' tcx > (
0 commit comments