Uh oh!
There was an error while loading. Please reload this page.
fix a few errant Krate edges - #35960
Conversation
There was a problem hiding this comment.
Should this field also be #[cfg(debug_assertions)]-ed?
michaelwoerister
commented
Aug 24, 2016
Good catches both! |
I remember a similar place in coherence where I intentionally held the lock because someone (i.e., metadata loading) was inserting stuff to the list behind my back and I wanted to prevent that problem from recurring. If nobody is supposed to mutate a list behind your back, holding a lock is the "safe" option - it can lead to more ICEs, but it can make your assumptions more visible. |
bors
commented
Aug 27, 2016
☔ The latest upstream changes (presumably #36030) made this pull request unmergeable. Please resolve the merge conflicts. |
e08d4fb to
30c6f12Comparenikomatsakis
commented
Aug 31, 2016
@bors r=mw |
bors
commented
Aug 31, 2016
📌 Commit 30c6f12 has been approved by |
nikomatsakis
commented
Sep 1, 2016
@bors r- |
Warnings from travis look legit, even though I didn't see anything like that locally. Maybe I didn't run full tests on the latest commit or something. |
30c6f12 to
386abe1Comparenikomatsakis
commented
Sep 1, 2016
@bors r=mw |
bors
commented
Sep 1, 2016
📌 Commit d287b7a has been approved by |
nikomatsakis
commented
Sep 2, 2016
@bors r- // again the travis issue looks legit, and again I wonder why I am not seeing this locally! |
d287b7a to
3b4e587Comparenikomatsakis
commented
Sep 2, 2016
The answer is sort of yes, but I wound up (see most recent commit) taking a different approach. In particular, the number of things that must have I'm not sure what's a better way to formulate the code here. It occurs to me now I could maybe make a |
nikomatsakis
commented
Sep 2, 2016
Oh, I am dumb, it's because I'm building with debug-assertions enabled, of course! |
nikomatsakis
commented
Sep 2, 2016
OK, so, I wound up implementing a better mechanism altogether. I'll push a few more commits shortly. |
54f8bdf to
cf7fd6bComparenikomatsakis
commented
Sep 2, 2016
r? @michaelwoerister -- this fixes one add'l bug, and revamps the forbidden stuff into something more powerful. |
2d893b3 to
bf27870Comparebors
commented
Sep 5, 2016
☔ The latest upstream changes (presumably #36203) made this pull request unmergeable. Please resolve the merge conflicts. |
The goal here is to avoid writing to the `inherent_impls` map from within the general `Coherence` task, and instead write to it as we visit. Writing to it from the Coherence task is actually an information leak; it happened to be safe because Coherence read from `DepNode::Krate`, but that was very coarse. I removed the `Rc` here because, upon manual inspection, nobody clones the data in this table, and it meant that we can accumulate the data in place. That said, the pattern that is used for the inherent impls map is *generally* an anti-pattern (that is, holding the borrow lock for the duration of using the contents), so it'd probably be better to clone (and I doubt that would be expensive -- how many inherent impls does a typical type have?).
We touch the krate to adjust the maps, but we don't expose that data widely.
It is useful to track down an errant edge that is being added. This is not a perfect mechanism, since it doesn't consider (e.g.) if we are in an ignored task, but it's helpful enough for now.
It was duplicating information available elsewhere.
The shadow graph supercedes the existing code that checked for reads/writes without an active task and now adds the ability to filter for specific edges.
Across crates only, converting a def-id into its def-key or def-path was considered a read. This caused spurious reads when computing the symbol name for some item.
supplanted by RUST_FORBID_DEP_GRAPH_EDGE
I also added an `opt_def_path` so that we can deal with DefIds that are missing a `DefPath` entry.
add licenses to shadow.rs
bf27870 to
c2ffa2fCompare| That first edge looks suspicious to you. So you set | ||
| `RUST_FORBID_DEP_GRAPH_EDGE` to `Hir&foo -> Collect&bar`, re-run, and | ||
| then observe the backtrace. Voila, bug fixed! |
michaelwoerister
commented
Sep 12, 2016
@bors r+ |
bors
commented
Sep 12, 2016
📌 Commit 9ca5786 has been approved by |
bors
commented
Sep 13, 2016
…oerister fix a few errant `Krate` edges Exploring the effect of small changes on `syntex` reuse, I discovered the following sources of unnecessary edges from `Krate` r? @michaelwoerister
Exploring the effect of small changes on
syntexreuse, I discovered the following sources of unnecessary edges fromKrater? @michaelwoerister