-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Infinitely recursive struct definitions compile successfully when behind fixed-size vector #11659
Labels
A-type-system
Area: Type system
Comments
Nice catch!
|
Oooh of course. |
(I'm testing a fix for this now.) |
#11661 (your understanding was correct, just needed to detect & handle fixed length vectors specifically). |
bors
added a commit
that referenced
this issue
Jan 20, 2014
…inger Previously, they were treated like ~[] and &[] (which can have length 0), but fixed length vectors are fixed length, i.e. we know at compile time if it's possible to have length zero (which is only for [T, .. 0]). Fixes #11659.
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Oct 21, 2023
[`manual_is_ascii_check`]: Also check for `is_ascii_hexdigt` changelog: [`manual_is_ascii_check`]: Also check for `is_ascii_hexdigt`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's no ICE or anything. The only problem is that the 'snippet 1' struct definitions are allowed, unlike those from snippet 2.
Without the vector-ness:
My understanding of what's going on:
Foo
andBar
from 'snippet 1' passtypeck::check::check_instantiable
, becausety::is_instantiable::subtype_requires
always returnsfalse
when matchingsty
variantsty_vec(_, _)
andty_unboxed_vec(_)
.Here's the relevant RUST_LOG output for Foo:
And for Bar:
#3779 is the most similar issue I could find. This bug is distinct because the struct isn't infinitely sized. If I understand the terms correctly, issue #3779 describes a failure to verify struct representability, whereas this issue describes a bug in verifying struct instantiability.
The text was updated successfully, but these errors were encountered: