-
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
Separate AnonConst from ConstBlock in HIR. #109609
Conversation
r? @lcnr (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@@ -465,6 +465,17 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> { | |||
|
|||
self.in_pat = in_pat; | |||
} | |||
|
|||
fn visit_inline_const(&mut self, c: &'tcx hir::ConstBlock) { |
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.
Do we still need the above visit_anon_const
if const blocks should be handled in visit_inline_const
instead?
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.
Yes. You still want to mark three
as live in:
match S::<3> {
S::<{three()}> => {}
}
r? @BoxyUwU |
☔ The latest upstream changes (presumably #96840) made this pull request unmergeable. Please resolve the merge conflicts. |
2477bc8
to
214cc17
Compare
What are the differing behaviours of anon consts and inline const that motivate this? Off the top of my head inline consts get typeck'd with their parent item and have weirder generics/typeof to allow for that wheras other anon consts get typeckd by themselves 🤔 |
☔ The latest upstream changes (presumably #111402) made this pull request unmergeable. Please resolve the merge conflicts. |
switching to author to reply to previous comment and rebase - thanks :) @rustbot author |
214cc17
to
c11147b
Compare
Some changes might have occurred in exhaustiveness checking cc @Nadrieril |
Yes, the difference in typeck root is the main reason to separate those cases IMO. Most of the cases where we end-up with code duplication are in side passes, with much less complexity than type collection. |
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.
sorry for taking so long to get to looking at this properly. r=me after rebasing
c11147b
to
ca4d0d4
Compare
@bors r+ |
…mpiler-errors Rollup of 6 pull requests Successful merges: - rust-lang#109609 (Separate AnonConst from ConstBlock in HIR.) - rust-lang#112166 (bootstrap: Rename profile = user to profile = dist) - rust-lang#112168 (Lower `unchecked_div`/`_rem` to MIR's `BinOp::Div`/`Rem`) - rust-lang#112183 (Normalize anon consts in new solver) - rust-lang#112211 (pass `--lib` to `x doc`) - rust-lang#112223 (Don't ICE in new solver when auto traits have associated types) r? `@ghost` `@rustbot` modify labels: rollup
Their behaviours are different enough to justify having separate nodes.