-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Move ty::ConstKind
to rustc_type_ir
#113321
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes might have occurred in exhaustiveness checking cc @Nadrieril |
r? @oli-obk |
24edb90
to
8b8a402
Compare
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.
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 guess I should not have reviewed commit by commit.
Looks ok modulo the mk_const removal.
Also probably requires clippy and miri changes
I will open a second PR to handle the construction of |
7dd5c6a
to
d89663e
Compare
This comment has been minimized.
This comment has been minimized.
af3396a
to
308ee8a
Compare
Separated out the construction changes to #113325 now the only changes in this PR are ones relevent to moving |
☔ The latest upstream changes (presumably #113325) made this pull request unmergeable. Please resolve the merge conflicts. |
308ee8a
to
62174bf
Compare
let kind = match self.kind() { | ||
ConstKind::Param(p) => ConstKind::Param(p.try_fold_with(folder)?), | ||
ConstKind::Infer(i) => ConstKind::Infer(i.try_fold_with(folder)?), | ||
ConstKind::Bound(d, b) => { | ||
ConstKind::Bound(d.try_fold_with(folder)?, b.try_fold_with(folder)?) | ||
} | ||
ConstKind::Placeholder(p) => ConstKind::Placeholder(p.try_fold_with(folder)?), | ||
ConstKind::Unevaluated(uv) => ConstKind::Unevaluated(uv.try_fold_with(folder)?), | ||
ConstKind::Value(v) => ConstKind::Value(v.try_fold_with(folder)?), | ||
ConstKind::Error(e) => ConstKind::Error(e.try_fold_with(folder)?), | ||
ConstKind::Expr(e) => ConstKind::Expr(e.try_fold_with(folder)?), | ||
}; |
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.
why isn't this an impl on the generic ConstKind
with the appropriate bounds?
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 just copied how the typefoldable stuff works for Ty
. which is that we have the impls on Ty
and TyKind
isnt TypeVisitable
or TypeFoldable
. It's a change from the status quo but it doesn't really seem like we acutally used ConstKind: TypeVisitable/TypeFoldable
anywhere except the Const: TypeVisitable/TypeFoldable
impl and I rather have Const
work the same as Ty
where possible.
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 suspected as much, makes sense, we can revisit if more usages ever come up
@bors r+ |
…r=oli-obk Move `ty::ConstKind` to `rustc_type_ir` Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver. Rebased on top of rust-lang#113325, only the second and third commits needs reviewing
…mpiler-errors Rollup of 8 pull requests Successful merges: - rust-lang#113010 (rust-installer & rls: remove exclusion from rustfmt & tidy ) - rust-lang#113317 ( -Ztrait-solver=next: stop depending on old solver) - rust-lang#113319 (`TypeParameterDefinition` always require a `DefId`) - rust-lang#113320 (Add some extra information to opaque type cycle errors) - rust-lang#113321 (Move `ty::ConstKind` to `rustc_type_ir`) - rust-lang#113337 (Winnow specialized impls during selection in new solver) - rust-lang#113355 (Move most coverage code out of `rustc_codegen_ssa`) - rust-lang#113356 (Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.) r? `@ghost` `@rustbot` modify labels: rollup
Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use
TyCtxt
so that r-a and friends can depend on the trait solver.Rebased on top of #113325, only the second and third commits needs reviewing