Skip to content

Commit 702ce8f

Browse files
incr.comp.: Remove outdated comment about TraitSelect dep-node.
1 parent 13bc7ad commit 702ce8f

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/librustc/dep_graph/dep_node.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -539,31 +539,6 @@ define_dep_nodes!( <'tcx>
539539

540540
[input] AllLocalTraitImpls,
541541

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.
567542
[anon] TraitSelect,
568543

569544
[] ParamEnv(DefId),

0 commit comments

Comments
 (0)