-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
add an unstable #[rustc_coinductive]
attribute
#108033
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
588ac14
to
b39861f
Compare
49d3ec5
to
de6cf80
Compare
de6cf80
to
a2f0303
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.
IDK about the test, which we can talk about later, but this implemenntation looks good.
@bors r+ |
…errors add an unstable `#[rustc_coinductive]` attribute useful to test coinduction, especially in the new solver. as this attribute should remain permanently unstable I don't think this needs any official approval. cc `@rust-lang/types` had to weaken the check for stable query results in the solver to prevent an ICE if there's a coinductive cycle with constraints. r? `@compiler-errors`
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#107573 (Update the minimum external LLVM to 14) - rust-lang#107626 (Fix `x fix` on the standard library itself) - rust-lang#107673 (update ICU4X to 1.1.0) - rust-lang#107733 (Store metrics from `metrics.json` to CI PGO timer) - rust-lang#108007 (Use `is_str` instead of string kind comparison) - rust-lang#108033 (add an unstable `#[rustc_coinductive]` attribute) - rust-lang#108039 (Refactor refcounted structural_impls via functors) - rust-lang#108040 (Use derive attributes for uninteresting traversals) - rust-lang#108044 (interpret: rename Pointer::from_addr → from_addr_invalid) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#107573 (Update the minimum external LLVM to 14) - rust-lang#107626 (Fix `x fix` on the standard library itself) - rust-lang#107673 (update ICU4X to 1.1.0) - rust-lang#107733 (Store metrics from `metrics.json` to CI PGO timer) - rust-lang#108007 (Use `is_str` instead of string kind comparison) - rust-lang#108033 (add an unstable `#[rustc_coinductive]` attribute) - rust-lang#108039 (Refactor refcounted structural_impls via functors) - rust-lang#108040 (Use derive attributes for uninteresting traversals) - rust-lang#108044 (interpret: rename Pointer::from_addr → from_addr_invalid) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
internal: support `#[rustc_coinductive]` rust-lang/rust#100386 changed the trait solver so that `Sized` is treated as coinductive trait, just like auto traits. This is now controlled by the perma-unstable `#[rustc_coinductive]` attribute (rust-lang/rust#108033), which this PR adds support for. In practice, I don't think this matters much if at all. Currently we don't give chalk enough information so chalk cannot precisely (dis)prove `Sized` bounds.
useful to test coinduction, especially in the new solver.
as this attribute should remain permanently unstable I don't think this needs any official approval. cc @rust-lang/types
had to weaken the check for stable query results in the solver to prevent an ICE if there's a coinductive cycle with constraints.
r? @compiler-errors