Uh oh!
There was an error while loading. Please reload this page.
Introduce TypeVisitor::BreakTy - #78779
Conversation
81f4cb3 to
b52a299CompareThere was a problem hiding this comment.
Yeah, I find the code so much cleaner this way 😄
There was a problem hiding this comment.
I don't see the advantage of using a type other than () for the break in this case.
There was a problem hiding this comment.
Oh right, I remember that comment. @lcnr can you elaborate on the motivation? We should encode it in documentation/comments
There was a problem hiding this comment.
Using a ZST we explicitly document the reasons we stop visiting and the reason we check if we terminated early.
While it isn't too relevant, it makes it easier to prevent bugs like stopping early because of a different reason and forgetting to update a call site. I also feel like using a ZST here has a very low cost and removes some questions on why we are using is_break and under which conditions we want to stop visiting.
Don't really care too much about this though
There was a problem hiding this comment.
I have nothing to argue against that 😆
If we can manage to remove is_break in that case (when all visitors have been migrated), then that would enforce this by there not being a way around it.
There was a problem hiding this comment.
Oh... now that I finished reading the PR, I think we should also stop having () as a default for BreakTy and require the user to specify one (or use ! as the default?)
There was a problem hiding this comment.
using ! as a default would be interesting 🤔 can't be misused and makes people notice the possibility
Uh oh!
There was an error while loading. Please reload this page.
b52a299 to
6995765CompareLeSeulArtichaut
commented
Nov 6, 2020
r? @oli-obk |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
this is such a huge improvement to the implementation which still used bools ❤️ thank you for implementing all of this
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
It looks to me like there are actually 2 visitors merged into 1 here.
The first one finds all opaque types and the second one then searches for inherited parent lifetimes, might make sense to try and split this. Not sure if you want to do this in one PR
There was a problem hiding this comment.
There was a problem hiding this comment.
Can ty.unwrap() fail here? I would expect this to not be the case. Might be missing something though.
Maybe if we have a PredicateAtom::RegionOutlives 🤔
There was a problem hiding this comment.
There was a problem hiding this comment.
yeah, but this only ends up returning None if we aren't inside of a type, as we would otherwise return Some(ty) there
edit: this may happen if the predicate is an outlives predicate though I don't know if they are possible for opaque types, don't have the capacity to look into this myself atm
LeSeulArtichaut
commented
Nov 6, 2020
We could change things in follow-up PRs. I made every change in a separate commit so I can easily drop some. |
df22308 to
a815e9eCompareThere was a problem hiding this comment.
Maybe create a self.check_flags method that handles this intersects call and the if-condition?
oli-obk
commented
Nov 15, 2020
r=me,lcnr with the dead function removed |
LeSeulArtichaut
commented
Nov 15, 2020
Done. |
oli-obk
commented
Nov 15, 2020
@bors r+ yea, I think we can safely send it to bors, too |
bors
commented
Nov 15, 2020
📌 Commit f6e6a15 has been approved by |
LeSeulArtichaut
commented
Nov 15, 2020
Should this be rollup=never as a medium-sized refractor? (I'm still trying to understand what deserves |
oli-obk
commented
Nov 15, 2020
for non-perf non prioritized things that probably conflict with a bunch of things we have @bors rollup=iffy |
bors
commented
Nov 16, 2020
⌛ Testing commit f6e6a15 with merge aacb816092fb150a8459de3135f62d6199fedf62... |
bors
commented
Nov 16, 2020
💥 Test timed out |
oli-obk
commented
Nov 16, 2020
@bors retry |
…r=oli-obk Introduce `TypeVisitor::BreakTy` Implements MCP rust-lang/compiler-team#383. r? `@ghost` cc `@lcnr` `@oli-obk` ~~Blocked on FCP in rust-lang/compiler-team#383.~~
bors
commented
Nov 17, 2020
bors
commented
Nov 17, 2020
☀️ Test successful - checks-actions |
…oli-obk Introduce `TypeVisitor::BreakTy` Implements MCP rust-lang/compiler-team#383. r? `@ghost` cc `@lcnr` `@oli-obk` ~~Blocked on FCP in rust-lang/compiler-team#383.~~
Implements MCP rust-lang/compiler-team#383.
r? @ghost
cc @lcnr@oli-obk
Blocked on FCP in rust-lang/compiler-team#383.