Skip to content

Stack overflow on pub use super::* #29181

Closed
@withoutboats

Description

@withoutboats

Updated 10/21: pub use super::* is currently valid Rust. I don't know if it should be, but it causes the compiler to blow its stack when recursively traversing a crate which contains it.

To reproduce:

  • Create a lib crate foo with this body: (compiles fine)
pub mod foo {
    pub use super::*;
}
  • Link to this crate, then include code that results in a method missing error, such as:
extern crate foo;

pub fn main() {
    0.flibbertigibit();
}

This will cause the stack to overflow in while it looks up traits in linked crates that define a method flibbertigibit(). There are probably other functions which overflow like this in the case of this text.

I would think either super::* should be smart enough to not recursively include the self module or super::* should be an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions