Skip to content

Odd "error[E0658]: is unstable" diagnostic #70538

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
jonas-schievink opened this issue Mar 29, 2020 · 2 comments · Fixed by #70576
Closed

Odd "error[E0658]: is unstable" diagnostic #70538

jonas-schievink opened this issue Mar 29, 2020 · 2 comments · Fixed by #70576
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-linkage Area: linking into static, shared libraries and binaries A-stability Area: `#[stable]`, `#[unstable]` etc. C-bug Category: This is a bug. D-papercut Diagnostics: An error or lint that needs small tweaks. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jonas-schievink
Copy link
Contributor

jonas-schievink commented Mar 29, 2020

#[link(name = "c", cfg(yes))]
extern {}
error[E0658]: is unstable
 --> src/lib.rs:1:1
  |
1 | #[link(name = "c", cfg(yes))]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: for more information, see https://github.com/rust-lang/rust/issues/37406

🤔

In addition to the malformed diagnostic, the tracking issue has been closed already. According to https://rust-lang.github.io/rfcs/1721-crt-static.html#lazy-link-attributes, this is supposed to be a permanently-unstable implementation detail. In that case, should the link be updated to point somewhere else?

This issue has been assigned to @Rustin-Liu via this comment.

@jonas-schievink jonas-schievink added A-linkage Area: linking into static, shared libraries and binaries A-diagnostics Area: Messages for errors, warnings, and lints A-stability Area: `#[stable]`, `#[unstable]` etc. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Mar 29, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 29, 2020
… r=varkor

#[link]: mention wasm_import_module instead of cfg

`#[link(cfg)]` is perma-unstable and is not documented anywhere else. It makes more sense to mention `wasm_import_module` here since it's stable.

This makes it harder to hit rust-lang#70538 (if it weren't for this text, I wouldn't even know this feature existed).
@estebank estebank added the D-papercut Diagnostics: An error or lint that needs small tweaks. label Mar 30, 2020
@estebank
Copy link
Contributor

The wording can be easily fixed at

feature_err(&self.tcx.sess.parse_sess, sym::link_cfg, span.unwrap(), "is unstable")
.

The link can't be changed to a non-issue because of how the machinery is currently set up, but we can update the description of the ticket to point at RFC 1721.

@estebank estebank added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Mar 30, 2020
@0xPoe
Copy link
Member

0xPoe commented Mar 31, 2020

@rustbot claim

@rustbot rustbot self-assigned this Mar 31, 2020
@bors bors closed this as completed in 17a59fb Apr 3, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-linkage Area: linking into static, shared libraries and binaries A-stability Area: `#[stable]`, `#[unstable]` etc. C-bug Category: This is a bug. D-papercut Diagnostics: An error or lint that needs small tweaks. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants