-
Notifications
You must be signed in to change notification settings - Fork 188
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
ADT recursion #963
base: fe-v2
Are you sure you want to change the base?
ADT recursion #963
Conversation
87b37f2
to
258a3c5
Compare
8e08b9d
to
313a6b5
Compare
53a0e86
to
abad1f4
Compare
18e75b8
to
4d93aee
Compare
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.
LGTM overall.
I'm not sure if it's nice to define Accumulator
s to handle several recursive errors(e.g, type alias cycle, adt definition cycle, etc...). It'd be nice if we could address this problem in a more generic way instead of having many Accumulator
s.
But this task should be addressed after v2 is published. So I'm inclined to merge this PR when the small nits I gave are fixed.
crates/hir-analysis/Cargo.toml
Outdated
@@ -15,7 +15,7 @@ either = "1.8" | |||
derive_more = "0.99" | |||
itertools = "0.10" | |||
ena = "0.14" | |||
indexmap = "1.6.2" | |||
fxhash = "0.2.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.
It's not necessary to add fxhash
since rustc-hash
contains FxHashMap
. I used fxhash
before, but rustc-hash
is more actively developed(I realized that parser2
crate uses fxhash
; I'll change parser2
dependency in #945).
@@ -44,6 +47,7 @@ use super::{ | |||
}, | |||
visitor::{walk_ty, TyVisitor}, | |||
}; | |||
use crate::ty::diagnostics::AdtRecursionConstituentAccumulator; |
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.
I've been considering the import order for a long time. This is bikeshedding, of course. But I feel grouping imports is more readable to me.
@sbillig @cburgdorf
What do you think about adding .rustfmt.toml
in the project root so that we don't need to care about formatting stuff?
The below one is my .rustfmt.toml
.
wrap_comments = true
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
edition = "2021"
One downside is that this configuration requires nightly
to run rustfmt
.
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.
I've added these rules to my .rustfmt as well
agreed. Ill generify this when implementing const cycle handling |
9d87c1a
to
a8e12ab
Compare
@g-r-a-n-t Micah fixed the wasm build in #984, which is now merged into fe-v2 |
a8e12ab
to
e3b2f62
Compare
13b18c4
to
08fe771
Compare
08fe771
to
c41af09
Compare
Added an accumulator that collects constituents of ADT recursions. These constituents are then combined and used to form diagnostics.
To-Do