make Sized predicates coinductive#83647
Closed
lcnr wants to merge 2 commits intorust-lang:masterfrom
Closed
Conversation
Contributor
|
I'm going to want to talk about the motivation =) |
Contributor
Author
|
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() {} |
Contributor
Author
|
also trait A { type Assoc: ?Sized; }
impl A for () {
type Assoc = Foo<()>;
}
struct Foo<T: A>(T::Assoc);
fn main() {
let x: Foo<()>;
} |
Member
|
triage: @lcnr - is this still blocked? |
Contributor
|
@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. |
Contributor
Author
|
don't have the capacity to work on this rn |
Contributor
|
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.
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Nov 11, 2022
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤷
needs either an MCP/RFC and
wg-traitssignoff. While I think this is sound, I am not too knowledgeable about coinduction so I might be wrong here.r? @nikomatsakis