-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
ICE expect Adt for unnamed field
#121263
Comments
smaller: #[repr(C)]
#[derive(Debug)]
struct L {
_: MyI32,
} |
Seems also to be the 1000th bug found since I started fuzzing 🎉 :) |
@rustbot claim |
While looking into this, it looks like error[E0609]: no field `_` on type `&L`
--> ../poc.rs:13:5
|
13 | _: A,
| ^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
13 | _: A,
| (which crashes with debug assertions due to an empty span). cc @frank-king |
…, r=<try> Check for accessing unnamed field in `find_field` Fixes rust-lang#121263 I'm not entirely sure this is the right solution, but it seems to work 😓
Disallowing can be a temporary solution. After structural expression for unnamed fields are fully implementated, we can revisit this issue and improve the deriving strategy for types with unnamed fields (but it only works for anonymous ADTs). Anyway, types with unnamed fields of named ADT can never be derived, since the proc macro is not able to fetch the nested fields info from another ADT defined elsewhere. |
auto-reduced (treereduce-rust):
original code
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
The text was updated successfully, but these errors were encountered: