gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Handle cycles in name resolution 2.0

Open CohenArthur opened this issue 2 years ago • 2 comments

https://github.com/Rust-GCC/gccrs/pull/2620#discussion_r1323015454

CohenArthur avatar Nov 08 '23 22:11 CohenArthur

@matthewjasper Do you have any rust example of cycles ? I initially thought this would be with super with no avail.

P-E-P avatar Nov 30 '23 14:11 P-E-P

I meant something like this:

pub mod a {
    pub use crate::b::*;
    pub struct A {}
}

mod b {
    pub use crate::a::*;
    pub use crate::c::*;
    pub struct B {}
}

mod c {
    pub use crate::b::*;
}

fn main() {
    let _x = b::A {};
    let _y = c::A {};
    let _z = c::B {};
}

matthewjasper avatar Nov 30 '23 15:11 matthewjasper