@@ -539,31 +539,6 @@ define_dep_nodes!( <'tcx>
539
539
540
540
[ input] AllLocalTraitImpls ,
541
541
542
- // Trait selection cache is a little funny. Given a trait
543
- // reference like `Foo: SomeTrait<Bar>`, there could be
544
- // arbitrarily many def-ids to map on in there (e.g., `Foo`,
545
- // `SomeTrait`, `Bar`). We could have a vector of them, but it
546
- // requires heap-allocation, and trait sel in general can be a
547
- // surprisingly hot path. So instead we pick two def-ids: the
548
- // trait def-id, and the first def-id in the input types. If there
549
- // is no def-id in the input types, then we use the trait def-id
550
- // again. So for example:
551
- //
552
- // - `i32: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Clone }`
553
- // - `u32: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Clone }`
554
- // - `Clone: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Clone }`
555
- // - `Vec<i32>: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Vec }`
556
- // - `String: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: String }`
557
- // - `Foo: Trait<Bar>` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }`
558
- // - `Foo: Trait<i32>` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }`
559
- // - `(Foo, Bar): Trait` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }`
560
- // - `i32: Trait<Foo>` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }`
561
- //
562
- // You can see that we map many trait refs to the same
563
- // trait-select node. This is not a problem, it just means
564
- // imprecision in our dep-graph tracking. The important thing is
565
- // that for any given trait-ref, we always map to the **same**
566
- // trait-select node.
567
542
[ anon] TraitSelect ,
568
543
569
544
[ ] ParamEnv ( DefId ) ,
0 commit comments