Skip to content

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

Closed
@pnkfelix

Description

@pnkfelix
Member

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.)

Activity

petrochenkov

petrochenkov commented on Apr 13, 2017

@petrochenkov
Contributor

Keywords: for better search

error: internal compiler error: src/librustc/middle/stability.rs:547: encountered unmarked API
added
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
on Jun 4, 2017
added a commit that references this issue on Dec 31, 2017

Auto merge of #47044 - topecongiro:fixed-ices, r=estebank

2d74ce2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @pnkfelix@frewsxcv@Mark-Simulacrum@petrochenkov

        Issue actions

          Locally pub but inaccessible items w/o stability attributes can cause an ICE · Issue #38857 · rust-lang/rust