Open liamnaddell opened 3 months ago
Interesting issue this because in my head i thought it would just be like C:
struct test {
int a;
int b;
};
void test()
{
struct test x = { .a = 1, .b = 2};
struct test y = x;
}
Hmmm not sure if this is something we should just be doing at the code-generation level or a new lint pass.
Interesting issue this because in my head i thought it would just be like C:
struct test { int a; int b; }; void test() { struct test x = { .a = 1, .b = 2}; struct test y = x; }
Hmmm not sure if this is something we should just be doing at the code-generation level or a new lint pass.
the example here is different than what I showed in the issue description, I think
I think the C equivalent would be
struct test {
int a;
int b;
};
void test()
{
struct test x = { .a = 1, .b = 2};
struct test y = struct test;
}
You should probably also get an error because a
is not mutable...
Here's a reproducer link:https://rust.godbolt.org/z/TKqKnMMs4
I am such an idiot i misread this
I am such an idiot i misread this
I made the exact same mistake when writing the code. It was only after compiling with rustc that I realized
Summary
gccrs lets you assign structs to variables, when rustc emits "expected value, found struct ..."
Reproducer
I tried this code:
Does the code make use of any (1.49) nightly feature ?
Godbolt link
No response
Actual behavior
The current behavior is...
The code compiles.
Expected behavior
I expected to see...
GCC Version
commit-hash: c83b22a6932240194879ea7d9e783a4c0daf1b79