|
| 1 | +<<<<<<< HEAD |
1 | 2 | pub(crate) mod encode;
|
2 | 3 |
|
3 | 4 | use std::collections::hash_map::Entry;
|
@@ -170,10 +171,12 @@ pub(crate) fn build_index<'tcx>(
|
170 | 171 | let exact_fqp = exact_paths
|
171 | 172 | .get(&defid)
|
172 | 173 | .or_else(|| external_paths.get(&defid).map(|&(ref fqp, _)| fqp))
|
173 |
| - // re-exports only count if the name is exactly the same |
174 |
| - // this is a size optimization, as well as a DWIM attempt |
175 |
| - // since if the names are not the same, the intent probably |
176 |
| - // isn't, either |
| 174 | + // Re-exports only count if the name is exactly the same. |
| 175 | + // This is a size optimization, since it means we only need |
| 176 | + // to store the name once (and the path is re-used for everything |
| 177 | + // exported from this same module). It's also likely to Do |
| 178 | + // What I Mean, since if a re-export changes the name, it might |
| 179 | + // also be a change in semantic meaning. |
177 | 180 | .filter(|fqp| fqp.last() == fqp.last());
|
178 | 181 | Some(insert_into_map(
|
179 | 182 | itemid_to_pathid,
|
@@ -356,10 +359,12 @@ pub(crate) fn build_index<'tcx>(
|
356 | 359 | .get(&defid)
|
357 | 360 | .or_else(|| external_paths.get(&defid).map(|&(ref fqp, _)| fqp));
|
358 | 361 | item.exact_path = exact_fqp.and_then(|fqp| {
|
359 |
| - // re-exports only count if the name is exactly the same |
360 |
| - // this is a size optimization, as well as a DWIM attempt |
361 |
| - // since if the names are not the same, the intent probably |
362 |
| - // isn't, either |
| 362 | + // Re-exports only count if the name is exactly the same. |
| 363 | + // This is a size optimization, since it means we only need |
| 364 | + // to store the name once (and the path is re-used for everything |
| 365 | + // exported from this same module). It's also likely to Do |
| 366 | + // What I Mean, since if a re-export changes the name, it might |
| 367 | + // also be a change in semantic meaning. |
363 | 368 | if fqp.last() != Some(&item.name) {
|
364 | 369 | return None;
|
365 | 370 | }
|
|
0 commit comments