-
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
make Sized
predicates coinductive
#83647
Conversation
I'm going to want to talk about the motivation =) |
I still want to add this as a test, so that I don't forget. I expect the error here to change from a predicate cycle to "recursive type trait A { type Assoc; }
impl A for () {
type Assoc = Foo<()>;
}
struct Foo<T: A>(T::Assoc);
fn main() {} |
also trait A { type Assoc: ?Sized; }
impl A for () {
type Assoc = Foo<()>;
}
struct Foo<T: A>(T::Assoc);
fn main() {
let x: Foo<()>;
} |
triage: @lcnr - is this still blocked? |
@lcnr is taking a bit of a break from Rust at the moment -- we could close this, but it's also ok to leave it open. |
don't have the capacity to work on this rn |
Would this allow to compile: use std::borrow::Cow;
#[derive(Clone)]
enum Test<'a> {
Int(u8),
Array(Cow<'a, [Test<'a>]>),
} ? |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as outdated.
This comment was marked as outdated.
…redux, r=lcnr Make `Sized` coinductive, again A revival of rust-lang#83647 --- What exactly makes co-induction sound? Better question: are there any unsoundness risks from this? `Sized` can't be implemented by custom `impl` blocks, nor can it be conditionally implemented based on anything other than child fields being `Sized`, right? r? `@nikomatsakis` for whenever he gets back from vacation
🤷
needs either an MCP/RFC and
wg-traits
signoff. While I think this is sound, I am not too knowledgeable about coinduction so I might be wrong here.r? @nikomatsakis