@@ -2342,42 +2342,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2342
2342
}
2343
2343
}
2344
2344
2345
- trait TraitObligationExt < ' tcx > {
2346
- fn derived_cause (
2347
- & self ,
2348
- variant : fn ( DerivedObligationCause < ' tcx > ) -> ObligationCauseCode < ' tcx > ,
2349
- ) -> ObligationCause < ' tcx > ;
2350
- }
2351
-
2352
- impl < ' tcx > TraitObligationExt < ' tcx > for TraitObligation < ' tcx > {
2353
- fn derived_cause (
2354
- & self ,
2355
- variant : fn ( DerivedObligationCause < ' tcx > ) -> ObligationCauseCode < ' tcx > ,
2356
- ) -> ObligationCause < ' tcx > {
2357
- /*!
2358
- * Creates a cause for obligations that are derived from
2359
- * `obligation` by a recursive search (e.g., for a builtin
2360
- * bound, or eventually a `auto trait Foo`). If `obligation`
2361
- * is itself a derived obligation, this is just a clone, but
2362
- * otherwise we create a "derived obligation" cause so as to
2363
- * keep track of the original root obligation for error
2364
- * reporting.
2365
- */
2366
-
2367
- let obligation = self ;
2368
-
2369
- // NOTE(flaper87): As of now, it keeps track of the whole error
2370
- // chain. Ideally, we should have a way to configure this either
2371
- // by using -Z verbose or just a CLI argument.
2372
- let derived_cause = DerivedObligationCause {
2373
- parent_trait_pred : obligation. predicate ,
2374
- parent_code : obligation. cause . clone_code ( ) ,
2375
- } ;
2376
- let derived_code = variant ( derived_cause) ;
2377
- ObligationCause :: new ( obligation. cause . span , obligation. cause . body_id , derived_code)
2378
- }
2379
- }
2380
-
2381
2345
impl < ' o , ' tcx > TraitObligationStack < ' o , ' tcx > {
2382
2346
fn list ( & ' o self ) -> TraitObligationStackList < ' o , ' tcx > {
2383
2347
TraitObligationStackList :: with ( self )
0 commit comments