-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup rustc/ty part 1 #54717
Cleanup rustc/ty part 1 #54717
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc/ty/query/job.rs
Outdated
|
||
// Zip them back together | ||
let mut stack: Vec<_> = spans.into_iter().zip(queries).collect(); | ||
stack.0.swap(0, stack.len() - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, I should have written stack.0.rotate_right(1)
here; I'll fix it as soon as I get some CI results (in case of any other issues).
src/librustc/ty/query/job.rs
Outdated
// Shift the stack so that our entry point is first | ||
let entry_point_pos = stack.iter().position(|(_, query)| query.as_ptr() == entry_point); | ||
if let Some(pos) = entry_point_pos { | ||
stack.shift_right(pos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one should have been stack.rotate_right(pos)
; weird it I now noticed it's behind a compilation flag; I'll fix this shortly.check
ed fine
src/librustc/ty/query/plumbing.rs
Outdated
return jobs; | ||
$( | ||
jobs.extend( | ||
self.$name.try_lock().unwrap().active.values().filter(|&v| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is borked too due to me not noticing the compilation flag.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #54809) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #54649) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebased. |
@bors r+ rollup |
📌 Commit 7ad21a8 has been approved by |
Cleanup rustc/ty part 1 Part 2 will follow soon; I wouldn't want these changes to rot too quickly. - improve stack shifting and remove related allocations - move a faster early return up - improve allocations - use Cow<str> where applicable - simplify common patterns - whitespace fixes
Rollup of 11 pull requests Successful merges: - #54078 (Expand the documentation for the `std::sync` module) - #54717 (Cleanup rustc/ty part 1) - #54781 (Add examples to `TyKind::FnDef` and `TyKind::FnPtr` docs) - #54787 (Only warn about unused `mut` in user-written code) - #54804 (add suggestion for inverted function parameters) - #54812 (Regression test for #32382.) - #54833 (make `Parser::parse_foreign_item()` return a foreign item or error) - #54834 (rustdoc: overflow:auto doesn't work nicely on small screens) - #54838 (Fix typo in src/libsyntax/parse/parser.rs) - #54851 (Fix a regression in 1.30 by reverting #53564) - #54853 (Remove unneccessary error from test, revealing NLL error.) Failed merges: r? @ghost
Part 2 will follow soon; I wouldn't want these changes to rot too quickly.