about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-06-28 08:34:04 -0400
committerNiko Matsakis <niko@alum.mit.edu>2018-06-28 08:34:04 -0400
commitcb349893320008f2cd9fcd42622564fc3b341b2b (patch)
tree4b35a0eb7efe2cd458ff9cf5d5d24c90dfca3b89 /src
parent5c06b23025b587f8665b2177369ad4a1da4d2153 (diff)
downloadrust-cb349893320008f2cd9fcd42622564fc3b341b2b.tar.gz
rust-cb349893320008f2cd9fcd42622564fc3b341b2b.zip
add explanatory comment
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/borrow_check/places_conflict.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_mir/borrow_check/places_conflict.rs b/src/librustc_mir/borrow_check/places_conflict.rs
index 92f5dc76bfc..24bd675fac2 100644
--- a/src/librustc_mir/borrow_check/places_conflict.rs
+++ b/src/librustc_mir/borrow_check/places_conflict.rs
@@ -219,6 +219,10 @@ fn place_components_conflict<'gcx, 'tcx>(
 /// innermost place and extends to projections (e.g., `a.b` would have
 /// the place `a` with a "next" pointer to `a.b`).  Created by
 /// `unroll_place`.
+///
+/// NB: This particular impl strategy is not the most obvious.  It was
+/// chosen because it makes a measurable difference to NLL
+/// performance, as this code (`places_conflict`) is somewhat hot.
 struct PlaceComponents<'p, 'tcx: 'p> {
     component: &'p Place<'tcx>,
     next: Option<&'p PlaceComponents<'p, 'tcx>>,