Rust-GCC / gccrs

GCC Front-End for Rust
https://rust-gcc.github.io/
GNU General Public License v2.0
2.4k stars 155 forks source link

Redefinition of `struct lang_type` in rust-tree.h and rust-lang.cc #1702

Open CohenArthur opened 1 year ago

CohenArthur commented 1 year ago

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108087

MahadMuhammad commented 1 year ago
CohenArthur commented 1 year ago

Done @DrMahad! Thank you :)

MahadMuhammad commented 1 year ago

First Solution:


---
thesamesam commented 1 year ago

As a non-gccrs person, just the person who filed the bug:

  1. Are they really the same type? If so, put it into a common place (if it's not already), and include it in both, and don't define it again. I don't think they are here, though.
  2. If they're not the same type, either rename one, or put it into an anonymous namespace.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108087#c4 makes it sound like it's not the same, just similar.

MahadMuhammad commented 1 year ago

Thank you @thesamesam for helping me in this issue.

philberty commented 1 year ago

The issue is that we have ported over constexpr support from C++ as Rust compiles time constant evaluation. But this meant porting over some of the C++ custom GCC bits. Its an awkward issue, probably one for me to sort out in a few weeks unless someone can extract it out into a shared header like @thesamesam has suggested and we talked about on zulip.

thesamesam commented 3 months ago

Quoting myself on BZ:

I think this was fixed by https://github.com/Rust-GCC/gccrs/pull/2586 -> r14-7947-g9048f08f4e9459.