Skip to content

Hundreds of missing stability attribute errors with trivial Externally Implementable Item (eii) function in library/std #150514

@Enselic

Description

@Enselic

Step-by-step:

  1. Add this simple eii function to library/std/src/lib.rs (like done in PR experiment: Add simple externally implementable item to std #150513):
#![feature(extern_item_impls)]

// ...

#[unstable(feature = "extern_item_impls", issue = "125418")]
#[eii]
pub fn changed_with_eii() -> bool {
    false
}
  1. Try to build
./x build library/std

Expected

No errors.

Actual

More than 800 missing stability attribute errors. See https://gist.github.com/Enselic/c643f454515db6f10caa7ab04045ab32 for all errors. The first three are:

$ ./x build library/std
   Compiling std v0.0.0 (/home/martin/src/rust-eii-unix-sigpipe/library/std)
error: attribute macro has missing stability attribute
    --> library/std/src/lib.rs:766:1
     |
 766 | #[eii]
     | ^^^^^^ in this attribute macro expansion
     |
    ::: library/core/src/macros/mod.rs:1899:5
     |
1899 |     pub macro eii($item:item) {
     |     ------------- in this expansion of `#[eii]`

error: function has missing stability attribute
   --> library/std/src/io/stdio.rs:726:1
    |
726 | pub fn cleanup() {
    | ^^^^^^^^^^^^^^^^

error: module has missing stability attribute
  --> library/std/src/sys/mod.rs:16:1
   |
16 | pub mod args;
   | ^^^^^^^^^^^^

Context

I am looking into replacing -Zon-broken-pipe=... with an eii. While doing so I encountered this problem. Tracking issue: #150588

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-extern_item_impls`#![feature(extern_item_impls)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions