Skip to content

Locally pub but inaccessible items w/o stability attributes can cause an ICE #38857

Closed
@pnkfelix

Description

@pnkfelix

Spawned off of #38689

There are still some cases where referencing an inaccessible item can cause the compiler to ICE.

Here is one crafted example (playpen)

fn main() {
    let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() };
}

but if std's module structure is revised then that example may fail to compile without ICE'ing for other reasons, so take care in understanding the issue: the change introduced by #38689 is skipping the requirement for stability attributes is slightly too narrow, in that it uses a local notion of pub/non-pub instead of overall accessibility.

One simple solution to this may be to just follow the suggestion here #38689 (comment) and just remove the assertion entirely. (I did not want to adopt that solution for a PR to be backported to beta, but I think it is worth considering doing in nightly alone to resolve this low priority issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions