From 702ce8f0a6d8a026343f0f162585ee4fd7ef81c1 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Wed, 8 Nov 2017 11:34:09 +0100 Subject: [PATCH] incr.comp.: Remove outdated comment about TraitSelect dep-node. --- src/librustc/dep_graph/dep_node.rs | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs index d05445e44dd..57e916e437f 100644 --- a/src/librustc/dep_graph/dep_node.rs +++ b/src/librustc/dep_graph/dep_node.rs @@ -539,31 +539,6 @@ define_dep_nodes!( <'tcx> [input] AllLocalTraitImpls, - // Trait selection cache is a little funny. Given a trait - // reference like `Foo: SomeTrait`, there could be - // arbitrarily many def-ids to map on in there (e.g., `Foo`, - // `SomeTrait`, `Bar`). We could have a vector of them, but it - // requires heap-allocation, and trait sel in general can be a - // surprisingly hot path. So instead we pick two def-ids: the - // trait def-id, and the first def-id in the input types. If there - // is no def-id in the input types, then we use the trait def-id - // again. So for example: - // - // - `i32: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Clone }` - // - `u32: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Clone }` - // - `Clone: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Clone }` - // - `Vec: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Vec }` - // - `String: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: String }` - // - `Foo: Trait` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }` - // - `Foo: Trait` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }` - // - `(Foo, Bar): Trait` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }` - // - `i32: Trait` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }` - // - // You can see that we map many trait refs to the same - // trait-select node. This is not a problem, it just means - // imprecision in our dep-graph tracking. The important thing is - // that for any given trait-ref, we always map to the **same** - // trait-select node. [anon] TraitSelect, [] ParamEnv(DefId),